From nobody Tue Oct 15 15:05:26 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 4XScpt505Tz5Z3HX; Tue, 15 Oct 2024 15:05:26 +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 4XScpt3KfTz465c; Tue, 15 Oct 2024 15:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004726; 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=vx7d34CyM5nq8/K9TE/bSIFytrLSmNJFtbiljEiZ/JQ=; b=tu0hvcoSCEKVRwgUcHIbtDX5C1hB8Ygw+XVTpm3AtRzYeuBK80Tg6C1TydFExhk6nWHj4t bMFy1SI5r6Zb/gWNpTIUjyAvbpd6pRZrxrZjoM1ESc2VRB9bp8+w3hoxrZCWgZ/v4hGhp3 RLByXxMthbJArpwn+LXm715pO9bEkoVo/326YNFcUiDRowU5kKF75yXYVUgS+Q7Vh+QD7L BPuY/4vWrXmunCH3WvOO3cRjC8h1NuLcE5EA86KW1R1V1/SiQwhr/uq8Vk+oCtnhfqJgrU 8vFUB1Z3gbAKDkVYW2sr/1ivsFHlZuDjS3QtI19SMitnxrZkOvjkTbZ2LX0PCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004726; 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=vx7d34CyM5nq8/K9TE/bSIFytrLSmNJFtbiljEiZ/JQ=; b=kzc6ttJOl+NSbgd2s884SAo8LNds/8COA//s19XVJk94+qn8jRbJ2XzcVY4FCEx4UigBJb Acyufzr9QzbEX/7CYKzWLLJmeir77sjQ/qB7lkIRhW+B5jcR/G9mwUkiY2gGLWo4/D4q2C JYHvbyegFiMx8x4D1sfFWciz3pE6shcQ7q2hTBCFK1X72cK/k2QtTRpUW5otGHPbc3DM/Z 3Uo/oHQtZzaarkDrmMNEpzSLvoikD4cCSvaooRSY3kLFSoRrLlGAaEOpIPYEFvAcLz2QCy Ad4/b2YNpmqGydYBK+dIzGjgCzb9zpfDSxqnmJzJxV6C80HeVe19jhf+iVoUWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729004726; a=rsa-sha256; cv=none; b=Wm0yOe5azs0wBPmMyKv3UK/bEJAEXQ2ZJweE2AvW/r2tVn00u/vKUs5mVapkkY6m/QBfve v1s0bgevoZmjhFjvIJQJH289rVgTxqRflpeKyV2eZJQexWfHlHnGCT1OrCc6WFookYOB1R wgFsXGyjQvWqKrTiwINjPXAmrkB9aySP1J8LjGQSbM1zwdKryuKBh/6XAfXvOMUWbqwXoE 70SEHYB1GOGB5uZtQVnQ0SQQYyXATHoeVdrOi9AoYB4K4JQYgl9BXt2IMf+xQ9riTeGDvX PcXTCdRqZ7lE356QehslvB2JyXBEi0s4NjtXNlbFpLmdeuYWs1foj6KPqjQV2Q== 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 4XScpt2SrZzRXN; Tue, 15 Oct 2024 15:05:26 +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 49FF5Qd0089277; Tue, 15 Oct 2024 15:05:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FF5Qa7089274; Tue, 15 Oct 2024 15:05:26 GMT (envelope-from git) Date: Tue, 15 Oct 2024 15:05:26 GMT Message-Id: <202410151505.49FF5Qa7089274@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: 4d5f771c439d - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d5f771c439df34d3c205acbd13eb1250095eeb0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4d5f771c439df34d3c205acbd13eb1250095eeb0 commit 4d5f771c439df34d3c205acbd13eb1250095eeb0 Author: Konstantin Belousov AuthorDate: 2024-10-05 09:20:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-15 14:50:16 +0000 kinfo_vmobject: report backing object of the SysV shm segments (cherry picked from commit 6a3fbdc7e9c8323a1c13c4afcc65f89cb47911e6) --- 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 70592eb44668..47f2984b1eff 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -579,6 +579,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. @@ -602,7 +604,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 76ae6118a756..a8821f0f2a8b 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,7 @@ #include #include #include +#include #include #include #include @@ -2517,6 +2519,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) { @@ -2564,6 +2568,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) { /* @@ -2601,6 +2606,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);