From nobody Mon Oct 07 08:25:03 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 4XMXJc1MTzz5XW7l; Mon, 07 Oct 2024 08:25:04 +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 4XMXJb6T1Nz4sn9; Mon, 7 Oct 2024 08:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728289503; 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=NVG/RSYMJWETDOIKyXAL0GYiZl2hZVyhVXz9OoYxt/8=; b=LdxAqpqHDDx98dnbZuNRP8MGfi+85LAndb3MFLnRVxa2nMvwwlAVvyEmf3P39G9p+usjSZ 82IzHx+cy2WxGtrf87lq3g2m80sie0GwdmUPpx1riyLjF5UUFH4VjbFGX6XyuOwnXdcDEG ms4Yq1qvGyEi6A8qOLA8uxK4+La11vSvh+vDPTGKm1wP18ZTwQr/deb0xdP3DkBYvwA8im eC+iyq1ligpkG+wt74hpsE/NSduKc/xW1o+mGa/W+LbQh/R7ttVMwV7n79CLahYDkLQd1P BFp+MSugVxUicQBHzFbRsDTwJSa9R8Vpe7NlKn5biN7Gyd97wK6q4Rdfpq7eXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728289503; 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=NVG/RSYMJWETDOIKyXAL0GYiZl2hZVyhVXz9OoYxt/8=; b=acNqxdDIRxWMVc0bncmkgTNgkCzGOGcvVeey06F0mwzKg9VxoNS5oIzWrKYH3oIvKWIauL V8piebCjIZLvdT8/eyZQXgwWp5A4V9DNCbmeQCmSU7rqcoD4mVqzSiqVEtix7sePINvN0R BzwQ6yHXNKQbSEOfjzsa8aJsXDpqQwnpYygjjK6OuMuXqwM9O4K4hklebiMJhC+S2AcTDP uUfxQ3GHi3rrqSBdOnLglk7anK4W8EIuzSVc5vDCCq8JgC5GfjU42dyQyxJLIeFZ0CEdB2 8DZ5XsAHPSxBVbBcIpWMGv0j44T7eWhe4Di6xD3kXjMKwsVCX6JeJRyuplmFUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728289503; a=rsa-sha256; cv=none; b=gihdlZNnBBnNg93BGn1j3qS9fdLtp4utz1SM6AJPD/tleefI2YHgCSVmrrFl0CLddFocQJ G1sFQ/I6Xg/X80F1orCMBrU2sRpTG651Mv/A2ZcQBLBCdi5u2PWIy3rnblORFd4Flk2tWp 22Cb4hRTLkEc/FqvjkVS+ks96gwLwZvxW8KYFw02Touia2hnJ3Xjse3PXiN6e4qo3dDPVQ hyb2hzZ2uCZtrJ60UlmJPG8/6uuS3NMc6xlXKr9DEyrmMwVN2bPuApTa3ELaoFAb2moUUA kwDosQOYKh3aCwkprUinougoorhPJ/lSZNE2EqJUu7GtOg92aPhsuZnMXbE4mg== 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 4XMXJb5Jv8zfZQ; Mon, 7 Oct 2024 08:25:03 +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 4978P3Bx012027; Mon, 7 Oct 2024 08:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4978P3oc012024; Mon, 7 Oct 2024 08:25:03 GMT (envelope-from git) Date: Mon, 7 Oct 2024 08:25:03 GMT Message-Id: <202410070825.4978P3oc012024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6a3fbdc7e9c8 - main - kinfo_vmobject: report backing object of the SysV shm segments 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/main X-Git-Reftype: branch X-Git-Commit: 6a3fbdc7e9c8323a1c13c4afcc65f89cb47911e6 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a3fbdc7e9c8323a1c13c4afcc65f89cb47911e6 commit 6a3fbdc7e9c8323a1c13c4afcc65f89cb47911e6 Author: Konstantin Belousov AuthorDate: 2024-10-05 09:20:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-07 08:22:12 +0000 kinfo_vmobject: report backing object of the SysV shm segments Use reserved work for kvo_flags. Mark such object with KVMO_FLAG_SYSVSHM. Provide segment key in kvo_vn_fileid, vnode never can back shm mapping. Provide sequence number in kvo_vn_fsid_freebsd11. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46959 --- sys/sys/user.h | 5 ++++- sys/vm/vm_object.c | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/sys/user.h b/sys/sys/user.h index 00cfbf09b4d6..1fd802b03a42 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -577,6 +577,8 @@ struct kinfo_vmentry { #define kve_vn_fsid kve_type_spec._kve_vn_fsid #define kve_obj kve_type_spec._kve_obj +#define KVMO_FLAG_SYSVSHM 0x0001 + /* * The "vm.objects" sysctl provides a list of all VM objects in the system * via an array of these entries. @@ -600,7 +602,8 @@ struct kinfo_vmobject { uint64_t kvo_me; /* Uniq handle for anon obj */ uint64_t _kvo_qspare[6]; uint32_t kvo_swapped; /* Number of swapped pages */ - uint32_t _kvo_ispare[7]; + uint32_t kvo_flags; + uint32_t _kvo_ispare[6]; char kvo_path[PATH_MAX]; /* Pathname, if any. */ }; #define kvo_vn_fsid kvo_type_spec._kvo_vn_fsid diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 86f9271341df..85fc27d169d6 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -77,6 +78,7 @@ #include #include #include +#include #include #include #include @@ -2506,6 +2508,8 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) vm_page_t m; u_long sp; int count, error; + key_t key; + unsigned short seq; bool want_path; if (req->oldptr == NULL) { @@ -2553,6 +2557,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) kvo->kvo_memattr = obj->memattr; kvo->kvo_active = 0; kvo->kvo_inactive = 0; + kvo->kvo_flags = 0; if (!swap_only) { TAILQ_FOREACH(m, &obj->memq, listq) { /* @@ -2590,6 +2595,12 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) kvo->kvo_swapped = sp > UINT32_MAX ? UINT32_MAX : sp; } VM_OBJECT_RUNLOCK(obj); + if ((obj->flags & OBJ_SYSVSHM) != 0) { + kvo->kvo_flags |= KVMO_FLAG_SYSVSHM; + shmobjinfo(obj, &key, &seq); + kvo->kvo_vn_fileid = key; + kvo->kvo_vn_fsid_freebsd11 = seq; + } if (vp != NULL) { vn_fullpath(vp, &fullpath, &freepath); vn_lock(vp, LK_SHARED | LK_RETRY);