From nobody Wed May 27 11:28:51 2026 X-Original-To: bugs@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 4gQS772WNDz6fs76 for ; Wed, 27 May 2026 11:28:51 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gQS771t7bz3vD3 for ; Wed, 27 May 2026 11:28:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779881331; 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: in-reply-to:in-reply-to:references:references; bh=KnTUTo4EdHSzMyhhRr0ZXaxZSayHhIEBiD0mf47S/Ds=; b=BLjYwKKapb2yfR9f2TsDxlnQQkXi9+JCiVYnEOb+7km5Rzhjw9CDpEIdcRu9lpHxxK4Efn g7fUofOag1LEEMshkb7Ov5J8J1e6ETEXLjHJE0XGij41kgePWNzqj1zEa8OHsVmtqgrHbb BKyOeVVCuEvM8oBjacrDjWnv6f4Vc2k1rc1qBjKVtvbMpW+auJQ56qaRtvJJhYXl/Kym3Q HaWdKjLsjpv1uXL5fuYprISPo71tUlmXBo1gCgv0W+LDEL2S4Wf77h3AYEnHzdvJWMybMi MyfN5l356vWGh8k1V0Aubpg7hgMZqNAcO9BTCr7lhCkV4pmlBt+o8so/gu5zVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779881331; a=rsa-sha256; cv=none; b=jjzWQBzW1gYi3QBMnWhtSA+9M33hnESKpYgArz6R+cUDUJuTmpxHBpMi6PHKDZMsxKqa11 0cQJXpZpxWYr/hvvB2oQvO2XR16m9gq84copt9SqXk65RM3XFkWsBD4Ef9V2Ph43KOKmxu XmBYJkYEVHtVPx09JriCHdlJQzB51SxczzkfwLRVrD9rGEeH0BtcsKO6tV6+jgEfw/2XfZ 8qxZoWF9ROeORrwkZo3ZqQsNmISx1Mz97ENCrCL4FU5WbRAxtaI4oh+P0qz3xmhDduQRag V+lchhLwL9Yd6gkCvgy2kcxiwUYQ12Sa/Yla7B/vRIEIz6IaarKKMYS4TSSOjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779881331; 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: in-reply-to:in-reply-to:references:references; bh=KnTUTo4EdHSzMyhhRr0ZXaxZSayHhIEBiD0mf47S/Ds=; b=CFANz6UjuHuuqSuBQc7K/NWI3/nMj1z3ny4ETVJuwvAKk5MrIX7wGhPLZIrKzEf8QUKsqx UG80R5p4ncMuo5SNaNODyWHIlL3bnVF5LEnXyddVp797vftYpKr+1r/NEFbMgNUvWrMI6i 08E0uPMHOwlhcsGQjI1VTKWRvnrtWIK3v14R4akoHKg5PTJUe8lXOQMZuNkuZ68OuKFtQq lWTYWtPC94yhkoWpHVyMIt3njT4UL6K2cusEkVIHwxlenYzYaKmO4R3KfPGlI851frtVRq 8x/A6U/fWcBf1oNXYTRT9G3dRU5P2UDovVTVtqGy+dbIhGd5f8O7OQjaocyl3g== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4gQS771J4FzxK1 for ; Wed, 27 May 2026 11:28:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 64RBSpSb081683 for ; Wed, 27 May 2026 11:28:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 64RBSpiL081682 for bugs@FreeBSD.org; Wed, 27 May 2026 11:28:51 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 271580] vmemoryuse counts shared memory as a sum for all processes Date: Wed, 27 May 2026 11:28:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: KOT@MATPOCKuH.Ru X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271580 --- Comment #3 from Dmitry Afanasiev --- Created attachment 271242 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D271242&action= =3Dedit dump code for tests I reproduced this on a fresh 14.4 system (fca6c9e8f747) using the attached simple test program. The following RCTL limits are configured: jail:pg199:memoryuse:deny=3D8589934592/user jail:pg199:vmemoryuse:deny=3D34359738368 When allocating 10 GB of shared memory, the program succeeds: [postgres9@pg199 ~]$ ./shm 10 mapped 10737418240 bytes at 0x823b13000 hello from parent hello from child top shows: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMM= AND 72662 779 1 59 0 10G 10G nanslp 7 0:08 0.00% shm 72663 779 1 59 0 10G 24K nanslp 8 0:08 0.00% shm However, in my opinion, allocation of 10 GB should be denied by the per-user memoryuse limit: jail:pg199:memoryuse:deny=3D8589934592/user When allocating 16 GB, fork() fails: [postgres9@pg199 ~]$ ./shm 16 mapped 17179869184 bytes at 0x8229fb000 fork: Resource temporarily unavailable Additionally, it appears that memoryuse may not be enforced at all. I also tested a direct jail-wide limit: rctl -r jail:pg199:memoryuse:deny=3D$((4*1024*1024*1024)) Despite this, the process was still able to allocate and fully populate 16 = GB of memory successfully. --=20 You are receiving this mail because: You are the assignee for the bug.=