Skip to contentSkip to conversation

ipc: HARD_MSGMAX should be higher not lower on 64bit

PATCH In review Amerigo Wang 3 participants 4 messages Dec 11, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipc: HARD_MSGMAX should be higher not lower on 64bit

It looks weird that we have HARD_MSGMAX lower on 64bit than on 32bit, since usually 64bit machines have more memory than 32bit machines.

Making it higher on 64bit seems reasonable, and keep the original number on 32bit.

Cc Serge E. Hallyn <[email protected]>
Cc Cedric Le Goater <[email protected]>

---

include/linux/ipc_namespace.h +1 -1
index e408722..07baa38 100644
@@ -87,7 +87,7 @@ extern int mq_init_ns(struct ipc_namespace *ns);
 /* default values */
 #define DFLT_QUEUESMAX 256     /* max number of message queues */
 #define DFLT_MSGMAX    10      /* max number of messages in each queue */
-#define HARD_MSGMAX    (131072/sizeof(void *))
+#define HARD_MSGMAX    (32768*sizeof(void *)/4)
 #define DFLT_MSGSIZEMAX 8192   /* max message size */
 #else
 static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; }
#1 lore raw
Quoted 2 lines · Amerigo Wang

It looks weird that we have HARD_MSGMAX lower on 64bit than on 32bit, since usually 64bit machines have more memory than 32bit machines.

It does look like this may have been an accident.

Quoted 13 lines

Making it higher on 64bit seems reasonable, and keep the original number on 32bit.

Cc Serge E. Hallyn <[email protected]>
Cc Cedric Le Goater <[email protected]>

---

include/linux/ipc_namespace.h +0 -0
index e408722..07baa38 100644

include/linux/ipc_namespace.h extern int mq_init_ns(struct ipc_namespace *ns); · line 90

Quoted 5 lines
include/linux/ipc_namespace.h +1 -1
@@ -87,7 +87,7 @@ extern int mq_init_ns(struct ipc_namespace *ns);
 /* default values */
 #define DFLT_QUEUESMAX 256     /* max number of message queues */
 #define DFLT_MSGMAX    10      /* max number of messages in each queue */
-#define HARD_MSGMAX    (131072/sizeof(void *))
+#define HARD_MSGMAX    (32768*sizeof(void *)/4)

why /4 ? You're now making it much smaller for 32-bit than it used to be?

Quoted 3 lines
include/linux/ipc_namespace.h +0 -0
 #define DFLT_MSGSIZEMAX 8192   /* max message size */
 #else
 static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; }
#2 lore raw

(Hi, I am the same person.)

Quoted 6 lines · Serge E. Hallyn
Quoted 2 lines · Amerigo Wang

It looks weird that we have HARD_MSGMAX lower on 64bit than on 32bit, since usually 64bit machines have more memory than 32bit machines.

It does look like this may have been an accident.

OK.

Quoted 7 lines
Quoted 7 lines

Making it higher on 64bit seems reasonable, and keep the original number on 32bit.

Cc Serge E. Hallyn <[email protected]>
Cc Cedric Le Goater <[email protected]>
Quoted 15 lines

include/linux/ipc_namespace.h extern int mq_init_ns(struct ipc_namespace *ns); · line 90

Quoted 11 lines

---

include/linux/ipc_namespace.h +1 -1
index e408722..07baa38 100644
@@ -87,7 +87,7 @@ extern int mq_init_ns(struct ipc_namespace *ns);
 /* default values */
 #define DFLT_QUEUESMAX 256     /* max number of message queues */
 #define DFLT_MSGMAX    10      /* max number of messages in each queue */
-#define HARD_MSGMAX    (131072/sizeof(void *))
+#define HARD_MSGMAX    (32768*sizeof(void *)/4)

why /4 ? You're now making it much smaller for 32-bit than it used to be?

Yes?

Before this patch, it is 131072/sizeof(void*) = 32768; after this patch, it is 32768*sizeof(void*)/4 = 32768 too. Both on 32bit, of course.

Am I missing something?

Signature · 1 line
Live like a child, think like the god.
#3 lore raw
Quoted 36 lines · Américo Wang

(Hi, I am the same person.)

Quoted 6 lines · Serge E. Hallyn
Quoted 2 lines · Amerigo Wang

It looks weird that we have HARD_MSGMAX lower on 64bit than on 32bit, since usually 64bit machines have more memory than 32bit machines.

It does look like this may have been an accident.

OK.

Quoted 7 lines
Quoted 7 lines

Making it higher on 64bit seems reasonable, and keep the original number on 32bit.

Cc Serge E. Hallyn <[email protected]>
Cc Cedric Le Goater <[email protected]>
Quoted 15 lines

include/linux/ipc_namespace.h extern int mq_init_ns(struct ipc_namespace *ns); · line 90

Quoted 11 lines

---

include/linux/ipc_namespace.h +1 -1
index e408722..07baa38 100644
@@ -87,7 +87,7 @@ extern int mq_init_ns(struct ipc_namespace *ns);
 /* default values */
 #define DFLT_QUEUESMAX 256     /* max number of message queues */
 #define DFLT_MSGMAX    10      /* max number of messages in each queue */
-#define HARD_MSGMAX    (131072/sizeof(void *))
+#define HARD_MSGMAX    (32768*sizeof(void *)/4)

why /4 ? You're now making it much smaller for 32-bit than it used to be?

Quoted 7 lines

Yes?

Before this patch, it is 131072/sizeof(void*) = 32768; after this patch, it is 32768*sizeof(void*)/4 = 32768 too. Both on 32bit, of course.

Am I missing something?

Haha, nope.

thanks,
-serge