From: Andrew Morton <akpm@linux-foundation.org>
To: Nadia.Derbey@bull.net
Cc: matthltc@us.ibm.com, linux-kernel@vger.kernel.org,
Solofo.Ramangalahy@bull.net
Subject: Re: [PATCH 1/1] IPC - Do not use a negative value to re-enable msgmni automatic recomputing
Date: Tue, 22 Jul 2008 03:34:04 -0700 [thread overview]
Message-ID: <20080722033404.c46aab44.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080704063729.600339000@bull.net>
On Fri, 04 Jul 2008 08:37:16 +0200 Nadia.Derbey@bull.net wrote:
> Resending after fixing the issues pointed out by Matt.
> Now applies to 2.6.26-rc8-mm1.
>
> [PATCH 01/01]
>
> This patch proposes an alternative to the "magical positive-versus-negative
> number trick" Andrew complained about last week in
> http://lkml.org/lkml/2008/6/24/418.
>
> This had been introduced with the patches that scale msgmni to the amount of
> lowmem. With these patches, msgmni has a registered notification routine
> that recomputes msgmni value upon memory add/remove or ipc namespace creation/
> removal.
>
> When msgmni is changed from user space (i.e. value written to the proc file),
> that notification routine is unregistered, and the way to make it registered
> back is to write a negative value into the proc file. This is the "magical
> positive-versus-negative number trick".
>
> To fix this, a new proc file is introduced: /proc/sys/kernel/auto_msgmni.
> This file acts as ON/OFF for msgmni automatic recomputing.
>
> With this patch, the process is the following:
> 1) kernel boots in "automatic recomputing mode"
> /proc/sys/kernel/msgmni contains the value that has been computed (depends
> on lowmem)
> /proc/sys/kernel/automatic_msgmni contains "1"
>
> 2) echo <val> > /proc/sys/kernel/msgmni
> . sets msg_ctlmni to <val>
> . de-activates automatic recomputing (i.e. if, say, some memory is added
> msgmni won't be recomputed anymore)
> . /proc/sys/kernel/automatic_msgmni now contains "0"
>
> 3) echo "0" > /proc/sys/kernel/automatic_msgmni
> . de-activates msgmni automatic recomputing
> this has the same effect as 2) except that msg_ctlmni's value stays
> blocked at its current value)
>
> 3) echo "1" > /proc/sys/kernel/automatic_msgmni
> . recomputes msgmni's value based on the current available memory size
> and number of ipc namespaces
> . re-activates automatic recomputing for msgmni.
>
Sigh. I suppose it's a bit better.
> ---
> include/linux/ipc_namespace.h | 3 +
> ipc/ipc_sysctl.c | 72 ++++++++++++++++++++++++++++++++++--------
> ipc/ipcns_notifier.c | 20 ++++++++---
Could we get this all documented for our poor users please?
Documentation/filesystems/proc.txt is probably the most appropriate
place.
next prev parent reply other threads:[~2008-07-22 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080704063715.300337000@bull.net>
2008-07-04 6:37 ` [PATCH 1/1] IPC - Do not use a negative value to re-enable msgmni automatic recomputing Nadia.Derbey
2008-07-22 10:34 ` Andrew Morton [this message]
2008-08-21 6:27 ` Nadia Derbey
[not found] <20080703121515.554681000@bull.net>
2008-07-03 12:15 ` Nadia.Derbey
2008-07-03 21:20 ` Matt Helsley
2008-07-04 5:28 ` Nadia Derbey
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=20080722033404.c46aab44.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Nadia.Derbey@bull.net \
--cc=Solofo.Ramangalahy@bull.net \
--cc=linux-kernel@vger.kernel.org \
--cc=matthltc@us.ibm.com \
/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