From nobody Tue Oct 08 12:39:26 2024 X-Original-To: dev-commits-src-main@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 4XNFvg2rGpz5ZNP4; Tue, 08 Oct 2024 12:39:27 +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 4XNFvf6Qgrz4bry; Tue, 8 Oct 2024 12:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728391166; 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=ti0SmXWF2IsRVIWXqCaO6xy+wZ+Eyc8ZGOTt8k199HA=; b=orm86XZa2M5RiFHwPzNBtEe9RBlQ4z5yek5K6uKf6n49GfMRURem2TrsUTgDAE7aRzWW4m 6rE48+cNI6tyhmqYZF3XsUVWi/5FAF7/LGS6b/UOzJfKKdBcTwSaG7Q1sTS81bOhlvCe5W skrreI/MNj2zd+EaH3zEL6ObBb/KLGu/lPLvg8lKju+BvQRjhaeUtqy2YV830uVGz4dWwn UcrPYujPhSKMCFPUwYKlK3GYt20mQSvQiN66Cvg9YuY1Sp/3JZTfpV1jRaoz3ZnL+SQjG1 yKTbid9L+mnOFzk/10IkbzQwbO/PuOzF+qDM/+sFyIaYWQ34qugSoGimdPPnPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728391166; 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=ti0SmXWF2IsRVIWXqCaO6xy+wZ+Eyc8ZGOTt8k199HA=; b=R0aq7SaqDaijy53Aa+RPIpae2JsUwYET+lyfKL86NAiORp25xQINDw/4NqXU8dRxurTfds msavkdVR/gJWGTYkXqKACT8LV3caIODkuylVT6i8skxzJ3HDjOgJ2wR3eo/0fUhZmX4VWs m+QtUWv6eDcGX8VjGnZMQ/Nv97i6S4zunrljET6pIWs4CFcYCu0Jb5lp8ghrPKNm5DuY1G IR8O34pxQIo1NiIfs0SwujKdoZTZlRc4cmT2FOytVP6R2lXhirJtN0pmbrOdzymNjKAZzK P7OF3KMq3dy9GCBFYrG9mFRP9Cte5/0g6BEzipqT83zFF2tNvF8ZCkJP99+7xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728391166; a=rsa-sha256; cv=none; b=pPHMeHqhBv9OXl5iKiymWeF88rSeIbpC23jiIVKfjnG8HchtdLuGvI75l9COMQJ2dGXuws cDpNrjPk0SQ4XH+2YxQXHkz4TEAPV71nW8snNxQaxKMyrjCuYAsQT2EnPCfhMOOZd2WqtA ci9tUfqrUNAUZnO+istd1cj8lvv5U17/c3GYSM7pHPJ7hX3P6bNZWroPUv09S+p2vrbCb0 8qBvbeUGu5okDcamovJRM5+f+Vg8GUUXyI6SVXLD1dvLStgl3+Okig8SsaLNUsQfWrd28h DwTQZY9ATipTGqdhNrnvSs19jBwhUjNitgBebAa+ScSvlOhIU/YLwXOUTwAHsA== 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 4XNFvf60fpzWPl; Tue, 8 Oct 2024 12:39: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 498CdQ1A013028; Tue, 8 Oct 2024 12:39:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 498CdQMf013025; Tue, 8 Oct 2024 12:39:26 GMT (envelope-from git) Date: Tue, 8 Oct 2024 12:39:26 GMT Message-Id: <202410081239.498CdQMf013025@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: b0b18b57a55b - main - sysctl vm.objects: report objects backing posix shm segments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b0b18b57a55b429cf3f625883da5dcb541b14960 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b0b18b57a55b429cf3f625883da5dcb541b14960 commit b0b18b57a55b429cf3f625883da5dcb541b14960 Author: Konstantin Belousov AuthorDate: 2024-10-07 01:55:16 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-08 12:38:15 +0000 sysctl vm.objects: report objects backing posix shm segments Add the KVMO_FLAG_POSIXSHM flag. Fill the path. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46970 --- sys/sys/user.h | 1 + sys/vm/vm_object.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/sys/sys/user.h b/sys/sys/user.h index 5703dababbe3..8f42cfa36476 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -582,6 +582,7 @@ struct kinfo_vmentry { #define kve_obj kve_type_spec._kve_obj #define KVMO_FLAG_SYSVSHM 0x0001 +#define KVMO_FLAG_POSIXSHM 0x0002 /* * The "vm.objects" sysctl provides a list of all VM objects in the system diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 6b9f89790ccd..0b9a8af2ccb1 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2601,6 +2601,11 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) kvo->kvo_vn_fileid = key; kvo->kvo_vn_fsid_freebsd11 = seq; } + if ((obj->flags & OBJ_POSIXSHM) != 0) { + kvo->kvo_flags |= KVMO_FLAG_POSIXSHM; + shm_get_path(obj, kvo->kvo_path, + sizeof(kvo->kvo_path)); + } if (vp != NULL) { vn_fullpath(vp, &fullpath, &freepath); vn_lock(vp, LK_SHARED | LK_RETRY);