Prev: add devname module aliases to allow module on-demand auto-loading
Next: What's up with wireless drivers?
From: Andrew Morton on 21 May 2010 16:40 On Thu, 20 May 2010 17:07:41 +1000 Nick Piggin <npiggin(a)suse.de> wrote: > Just wondering whether there is a good reason to have a full 16 bits of > sequence in ipc ids? 32K indexes is pretty easy to overflow, if only in > stress tests for now. I was doing some big aim7 stress testing, which > required this patch, but it's not exactly a realistic workload :) > > But the sequence seems like it just helps slightly with buggy apps, and > if the app is buggy then it can by definition mess up its own ids > anyway? So I don't see that such amount of seq is required. > > Index: linux-2.6/ipc/util.h > =================================================================== > --- linux-2.6.orig/ipc/util.h > +++ linux-2.6/ipc/util.h > @@ -14,7 +14,16 @@ > #include <linux/err.h> > > /* IPCMNI_MAX should be <= MAX_INT, absolute limit for ipc arrays */ > -#define IPCMNI_MAX_SHIFT 15 > +/* > + * IPC ids consist of an index into the idr, which allocates from the bottom > + * up, and a sequence number which is continually incremented. Valid indexes > + * are from 0..IPCMNI_MAX (or further constrained by sysctls or other limits). > + * The sequence number prevents ids from being reused quickly. The sequence > + * number resides in the top part of the 'int' after IPCMNI_MAX. > + * > + * Increasing IPCMNI_MAX reduces the sequence wrap interval. > + */ > +#define IPCMNI_MAX_SHIFT 20 > #define IPCMNI_MAX (1 << IPCMNI_MAX_SHIFT) > > #define SEQ_SHIFT IPCMNI_MAX_SHIFT Some anaylsis of the worst-case memory consumption would be mollifying. I took the absence of Signed-off-by:'s to mean "rfc" and wandered away. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Nick Piggin on 24 May 2010 03:50
On Fri, May 21, 2010 at 01:31:36PM -0700, Andrew Morton wrote: > On Thu, 20 May 2010 17:07:41 +1000 > Nick Piggin <npiggin(a)suse.de> wrote: > > > Just wondering whether there is a good reason to have a full 16 bits of > > sequence in ipc ids? 32K indexes is pretty easy to overflow, if only in > > stress tests for now. I was doing some big aim7 stress testing, which > > required this patch, but it's not exactly a realistic workload :) > > > > But the sequence seems like it just helps slightly with buggy apps, and > > if the app is buggy then it can by definition mess up its own ids > > anyway? So I don't see that such amount of seq is required. > > > > Index: linux-2.6/ipc/util.h > > =================================================================== > > --- linux-2.6.orig/ipc/util.h > > +++ linux-2.6/ipc/util.h > > @@ -14,7 +14,16 @@ > > #include <linux/err.h> > > > > /* IPCMNI_MAX should be <= MAX_INT, absolute limit for ipc arrays */ > > -#define IPCMNI_MAX_SHIFT 15 > > +/* > > + * IPC ids consist of an index into the idr, which allocates from the bottom > > + * up, and a sequence number which is continually incremented. Valid indexes > > + * are from 0..IPCMNI_MAX (or further constrained by sysctls or other limits). > > + * The sequence number prevents ids from being reused quickly. The sequence > > + * number resides in the top part of the 'int' after IPCMNI_MAX. > > + * > > + * Increasing IPCMNI_MAX reduces the sequence wrap interval. > > + */ > > +#define IPCMNI_MAX_SHIFT 20 > > #define IPCMNI_MAX (1 << IPCMNI_MAX_SHIFT) > > > > #define SEQ_SHIFT IPCMNI_MAX_SHIFT > > Some anaylsis of the worst-case memory consumption would be mollifying. OK. > I took the absence of Signed-off-by:'s to mean "rfc" and wandered away. Yes. They should probably go through Manfred to you anyway. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |