From nobody Tue Oct 15 15:05:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XScqB3m47z5YYSh; Tue, 15 Oct 2024 15:05:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XScqB1cM4z46jb; Tue, 15 Oct 2024 15:05:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZGVlnukS3u8MznP0roWIxsRuYIr6EY1veT5J/Tr1kos=; b=LOuHl7Q6pu+uKFqNR5LICDHA2rEIHdN5zQuw7ZUEwaLupRyfPZ388CyVqjyTMC2lpwgqTE e8++fr/cOzLYJw0HDSF7O7WPSvVlDYovkhp5THZ3aR8m91BB2zhhjp5wCX59/UsQJpxzjM WqgrrWNTql93To4uAoez3qyhEdjRmSeb3LXEJX/aGGa9qz5y74J/BdiNpK2GThu1cQT0ly KCkPqkcPqpuI+zxVARNObrDtBtfzBfEC6ArfWHDZHOuJh7TKx0kLEubrTkPN+uoq9EbG+P dBhLNZ0uAh0Cpw6QeWu0pIvl0qGqXtzrAgoRG3zHVfZbg+lDzoen/9+cwepQvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZGVlnukS3u8MznP0roWIxsRuYIr6EY1veT5J/Tr1kos=; b=f/LuEmgX66qAewTdlJFF7L/dCxp1Waf8Fwt8nsg23WHLBrRBX7VP7nAiifbtNVUcQXeQxl 4ing1PEdtucFSgfClSIVFJzdVDPBPFssyuz5pBe+evwpuhG3lsz6y1wOkvg0IXclufrhT9 n7rBrYJaHpg3YQyS3F5z3CaL95QjwXVVxwlXpEEcFKNFofTT5kf+rjSTMu/Jyzc+XWb3aS deHkTy40XFph1N7Cu0qLKNJy66bkNW3kamHfutdW0if+qQ5mNbCRPa9ka70xG9Ye7hGn4r cRz2nOCAh6G5ApV26GiyYRAP+Nc81cdAXaD2Wt8Fdyq+SOcXx12z75WoVMFArw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729004742; a=rsa-sha256; cv=none; b=UuVEEn6pNLuGo1aqjUhAJx2EYMZQlorWYO0Fs2yt5R3c1JlSxJogFKmVTvD406LOQ//LuM z6rp5XI95+O4iqXmeUqHLOxWvdiJTQpYGiWnxjFPurpCIg9j6RtColBPk1TvmVJ0IfKnQD Z9BMLOGikGF3SJRR5G2Aj+Y9r/lF+RWxFsD3AUcAX8Zbq/A8e2kLiTAI7iGHtBtQrCBxre jrNedsHUu9mKS2mLXCieuUWUjwkl7ysC2R6Q6hRvIMDnaTvNgTIu98FTUBunPfnRcAcglk reb892axWx/EDh4QGjNg2sl8O0kGlbUUWSVLuGWSE4RBaUOFiyF+5IGbSTLe8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XScqB1DmhzRT8; Tue, 15 Oct 2024 15:05:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49FF5gPQ089953; Tue, 15 Oct 2024 15:05:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FF5gFS089950; Tue, 15 Oct 2024 15:05:42 GMT (envelope-from git) Date: Tue, 15 Oct 2024 15:05:42 GMT Message-Id: <202410151505.49FF5gFS089950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dfe83ae4da34 - stable/14 - sysctl vm.vm_objects: report cdev name for device-backed objects List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dfe83ae4da34798a7bd0e6c7607b548ead4a1869 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dfe83ae4da34798a7bd0e6c7607b548ead4a1869 commit dfe83ae4da34798a7bd0e6c7607b548ead4a1869 Author: Konstantin Belousov AuthorDate: 2024-10-10 09:37:19 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-15 15:03:59 +0000 sysctl vm.vm_objects: report cdev name for device-backed objects (cherry picked from commit d9daa28c364d0b1189ab616d8d697b4c9f748038) --- sys/vm/vm_object.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index d0f367815469..d2ac8f696634 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -68,6 +68,7 @@ #include #include +#include #include #include #include @@ -2517,8 +2518,10 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) struct vattr va; vm_object_t obj; vm_page_t m; + struct cdev *cdev; + struct cdevsw *csw; u_long sp; - int count, error; + int count, error, ref; key_t key; unsigned short seq; bool want_path; @@ -2605,6 +2608,17 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) sp = swap_pager_swapped_pages(obj); kvo->kvo_swapped = sp > UINT32_MAX ? UINT32_MAX : sp; } + if (obj->type == OBJT_DEVICE || obj->type == OBJT_MGTDEVICE) { + cdev = obj->un_pager.devp.dev; + if (cdev != NULL) { + csw = dev_refthread(cdev, &ref); + if (csw != NULL) { + strlcpy(kvo->kvo_path, cdev->si_name, + sizeof(kvo->kvo_path)); + dev_relthread(cdev, ref); + } + } + } VM_OBJECT_RUNLOCK(obj); if ((obj->flags & OBJ_SYSVSHM) != 0) { kvo->kvo_flags |= KVMO_FLAG_SYSVSHM;