Linux-man Archive mirror
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Alexey Gladkov <legion@kernel.org>,
	linux-doc <linux-man@vger.kernel.org>
Subject: Re: [RESEND PATCH v3 2/3] docs: Add information about ipc sysctls limitations
Date: Sun, 21 Jan 2024 16:58:52 +0100	[thread overview]
Message-ID: <e18a3f68-3fe0-49ee-8a2c-3bae2604476f@colorfullife.com> (raw)
In-Reply-To: <09e99911071766958af488beb4e8a728a4f12135.1705333426.git.legion@kernel.org>

Hi Alexey,


On 1/15/24 16:46, Alexey Gladkov wrote:
> After 25b21cb2f6d6 ("[PATCH] IPC namespace core") and 4e9823111bdc
> ("[PATCH] IPC namespace - shm") the shared memory page count stopped
> being global and started counting per ipc namespace. The documentation
> and shmget(2) still says that shmall is a global option.
>
> shmget(2):
>
> SHMALL System-wide limit on the total amount of shared memory, measured
> in units of the system page size. On Linux, this limit can be read and
> modified via /proc/sys/kernel/shmall.
>
> I think the changes made in 2006 should be documented.
>
> Signed-off-by: Alexey Gladkov <legion@kernel.org>
> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
> Link: https://lkml.kernel.org/r/ede20ddf7be48b93e8084c3be2e920841ee1a641.1663756794.git.legion@kernel.org
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> ---
>   Documentation/admin-guide/sysctl/kernel.rst | 14 +++++++++++---
>   1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
> index 6584a1f9bfe3..bc578663619d 100644
> --- a/Documentation/admin-guide/sysctl/kernel.rst
> +++ b/Documentation/admin-guide/sysctl/kernel.rst
> @@ -594,6 +594,9 @@ default (``MSGMNB``).
>   ``msgmni`` is the maximum number of IPC queues. 32000 by default
>   (``MSGMNI``).
>   
> +All of these parameters are set per ipc namespace. The maximum number of bytes
> +in POSIX message queues is limited by ``RLIMIT_MSGQUEUE``. This limit is
> +respected hierarchically in the each user namespace.

This block is about mqueue, not about SHM.

Could you mention the change also in the change description.

And: It is not fully clear to me what you mean with "respected 
hierarchically"

>   
>   msg_next_id, sem_next_id, and shm_next_id (System V IPC)
>   ========================================================
> @@ -1274,15 +1277,20 @@ are doing anyway :)
>   shmall
>   ======
>   
> -This parameter sets the total amount of shared memory pages that
> -can be used system wide. Hence, ``shmall`` should always be at least
> -``ceil(shmmax/PAGE_SIZE)``.
> +This parameter sets the total amount of shared memory pages that can be used
> +inside ipc namespace. The shared memory pages counting occurs for each ipc
> +namespace separately and is not inherited. Hence, ``shmall`` should always be at
> +least ``ceil(shmmax/PAGE_SIZE)``.
>   
>   If you are not sure what the default ``PAGE_SIZE`` is on your Linux
>   system, you can run the following command::
>   
>   	# getconf PAGE_SIZE
>   
> +To reduce or disable the ability to allocate shared memory, you must create a
> +new ipc namespace, set this parameter to the required value and prohibit the
> +creation of a new ipc namespace in the current user namespace or cgroups can
> +be used.

cgroups are an alternative to which part of the sentence?

"prohibit the creation of a new ipc namespace"? or to the whole sentence?

+To reduce or disable the ability to allocate shared memory, you must
+ * create a new ipc namespace, set this parameter to the required value and
+   prohibit the creation of a new ipc namespace in the current user namespace
+ * use cgroups


--

     Manfred


           reply	other threads:[~2024-01-21 15:58 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <09e99911071766958af488beb4e8a728a4f12135.1705333426.git.legion@kernel.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e18a3f68-3fe0-49ee-8a2c-3bae2604476f@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=legion@kernel.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).