public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Manfred Spraul <manfred@colorfullife.com>, linux-kernel@vger.kernel.org
Subject: [patch 3/3] ipc: increase IPCMNI_MAX
Date: Thu, 20 May 2010 17:07:41 +1000	[thread overview]
Message-ID: <20100520070741.GI2516@laptop> (raw)
In-Reply-To: <20100520065911.GG2516@laptop>

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

  parent reply	other threads:[~2010-05-20  7:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20  6:59 [patch 1/3] ipc: rename IPCMNI to IPCMNI_MAX Nick Piggin
2010-05-20  7:00 ` [patch 2/3] ipc: use shifts to extract seq/idx Nick Piggin
2010-05-20 18:16   ` Manfred Spraul
2010-05-21  1:33     ` Nick Piggin
2010-05-20  7:07 ` Nick Piggin [this message]
2010-05-21 20:31   ` [patch 3/3] ipc: increase IPCMNI_MAX Andrew Morton
2010-05-24  7:43     ` Nick Piggin

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=20100520070741.GI2516@laptop \
    --to=npiggin@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.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