* [PATCH] ipc: always handle a new value of auto_msgmni
@ 2014-08-13 13:21 Andrey Vagin
2014-08-14 9:37 ` Manfred Spraul
0 siblings, 1 reply; 5+ messages in thread
From: Andrey Vagin @ 2014-08-13 13:21 UTC (permalink / raw)
To: linux-kernel
Cc: Andrey Vagin, Andrew Morton, Mathias Krause, Manfred Spraul,
Joe Perches, Davidlohr Bueso
proc_dointvec_minmax() returns zero, if a new value has been set.
So we don't need to check all charectes have been handled.
Below you can find two examples. In the new value has not been
handled properly.
$ strace ./a.out
open("/proc/sys/kernel/auto_msgmni", O_WRONLY) = 3
write(3, "0\n\0", 3) = 2
close(3) = 0
exit_group(0)
$ cat /sys/kernel/debug/tracing/trace
$strace ./a.out
open("/proc/sys/kernel/auto_msgmni", O_WRONLY) = 3
write(3, "0\n", 2) = 2
close(3) = 0
$ cat /sys/kernel/debug/tracing/trace
a.out-697 [000] .... 3280.998235: unregister_ipcns_notifier <-proc_ipcauto_dointvec_minmax
Fixes: 9eefe520c814 ("ipc: do not use a negative value to re-enable msgmni automatic recomputin")
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mathias Krause <minipli@googlemail.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Joe Perches <joe@perches.com>
Cc: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
ipc/ipc_sysctl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index c3f0326..e8075b2 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -123,7 +123,6 @@ static int proc_ipcauto_dointvec_minmax(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct ctl_table ipc_table;
- size_t lenp_bef = *lenp;
int oldval;
int rc;
@@ -133,7 +132,7 @@ static int proc_ipcauto_dointvec_minmax(struct ctl_table *table, int write,
rc = proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos);
- if (write && !rc && lenp_bef == *lenp) {
+ if (write && !rc) {
int newval = *((int *)(ipc_table.data));
/*
* The file "auto_msgmni" has correctly been set.
--
1.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] ipc: always handle a new value of auto_msgmni
2014-08-13 13:21 [PATCH] ipc: always handle a new value of auto_msgmni Andrey Vagin
@ 2014-08-14 9:37 ` Manfred Spraul
2014-08-14 13:34 ` Andrew Vagin
0 siblings, 1 reply; 5+ messages in thread
From: Manfred Spraul @ 2014-08-14 9:37 UTC (permalink / raw)
To: Andrey Vagin, linux-kernel
Cc: Andrew Morton, Mathias Krause, Joe Perches, Davidlohr Bueso
Hi Andrey,
On 08/13/2014 03:21 PM, Andrey Vagin wrote:
> proc_dointvec_minmax() returns zero, if a new value has been set.
> So we don't need to check all charectes have been handled.
What do you use auto_msgmni for?
I would propose to remove the whole logic - just always allow 32000
message queues.
--
Manfred
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ipc: always handle a new value of auto_msgmni
2014-08-14 9:37 ` Manfred Spraul
@ 2014-08-14 13:34 ` Andrew Vagin
2014-08-16 20:29 ` Manfred Spraul
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Vagin @ 2014-08-14 13:34 UTC (permalink / raw)
To: Manfred Spraul
Cc: Andrey Vagin, linux-kernel, Andrew Morton, Mathias Krause,
Joe Perches, Davidlohr Bueso
On Thu, Aug 14, 2014 at 11:37:45AM +0200, Manfred Spraul wrote:
> Hi Andrey,
>
> On 08/13/2014 03:21 PM, Andrey Vagin wrote:
> >proc_dointvec_minmax() returns zero, if a new value has been set.
> >So we don't need to check all charectes have been handled.
> What do you use auto_msgmni for?
We disable it to check that criu restores a value of the msgmni sysctl correctly.
https://github.com/xemul/criu/blob/master/test/zdtm/live/static/ipc_namespace.c
>
> I would propose to remove the whole logic - just always allow 32000 message
> queues.
I don't have objections.
>
> --
> Manfred
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ipc: always handle a new value of auto_msgmni
2014-08-14 13:34 ` Andrew Vagin
@ 2014-08-16 20:29 ` Manfred Spraul
2014-08-19 6:42 ` Andrew Vagin
0 siblings, 1 reply; 5+ messages in thread
From: Manfred Spraul @ 2014-08-16 20:29 UTC (permalink / raw)
To: Andrew Vagin
Cc: Andrey Vagin, linux-kernel, Andrew Morton, Mathias Krause,
Joe Perches, Davidlohr Bueso
Hi Andrew,
On 08/14/2014 03:34 PM, Andrew Vagin wrote:
> On Thu, Aug 14, 2014 at 11:37:45AM +0200, Manfred Spraul wrote:
>> Hi Andrey,
>>
>> [...]
>> What do you use auto_msgmni for?
> We disable it to check that criu restores a value of the msgmni sysctl correctly.
>
> https://github.com/xemul/criu/blob/master/test/zdtm/live/static/ipc_namespace.c
Thanks for the link, if I see it right, my patch would break your code:
http://marc.info/?l=linux-kernel&m=140782863804950
It removes auto_msgmni - and
What do you think, should I leave auto_msgmni as a stale variable,
perhaps with a pr_info() that it doesn't have any effect?
--
Manfred
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ipc: always handle a new value of auto_msgmni
2014-08-16 20:29 ` Manfred Spraul
@ 2014-08-19 6:42 ` Andrew Vagin
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Vagin @ 2014-08-19 6:42 UTC (permalink / raw)
To: Manfred Spraul
Cc: Andrey Vagin, linux-kernel, Andrew Morton, Mathias Krause,
Joe Perches, Davidlohr Bueso
On Sat, Aug 16, 2014 at 10:29:16PM +0200, Manfred Spraul wrote:
> Hi Andrew,
>
> On 08/14/2014 03:34 PM, Andrew Vagin wrote:
> >On Thu, Aug 14, 2014 at 11:37:45AM +0200, Manfred Spraul wrote:
> >>Hi Andrey,
> >>
> >>[...]
> >>What do you use auto_msgmni for?
> >We disable it to check that criu restores a value of the msgmni sysctl correctly.
> >
> >https://github.com/xemul/criu/blob/master/test/zdtm/live/static/ipc_namespace.c
> Thanks for the link, if I see it right, my patch would break your code:
>
> http://marc.info/?l=linux-kernel&m=140782863804950
>
> It removes auto_msgmni - and
> What do you think, should I leave auto_msgmni as a stale variable, perhaps
> with a pr_info() that it doesn't have any effect?
Yes, you should. For example "criu restore" will start failing, if you remove
auto_msgmni.
>
>
> --
> Manfred
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-19 6:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-13 13:21 [PATCH] ipc: always handle a new value of auto_msgmni Andrey Vagin
2014-08-14 9:37 ` Manfred Spraul
2014-08-14 13:34 ` Andrew Vagin
2014-08-16 20:29 ` Manfred Spraul
2014-08-19 6:42 ` Andrew Vagin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox