ipc: HARD_MSGMAX should be higher not lower on 64bit
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.
---
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)#define DFLT_MSGSIZEMAX 8192/* max message size */ #else static inline int mq_init_ns (struct ipc_namespace *ns) {return 0 ; }
Quoted 2 lines · Amerigo Wang
It looks weird that we have
HARD_MSGMAXlower 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]>Signed-off-by WANG Cong <[email protected]>---
include/linux/ipc_namespace.h +0
-0
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 ; }
(Hi, I am the same person.)
Quoted 6 lines · Serge E. Hallyn
Quoted 2 lines · Amerigo Wang
It looks weird that we have
HARD_MSGMAXlower 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]>Signed-off-by WANG Cong <[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@@ -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.
Serge E. Hallyn
Acked-byQuoted 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_MSGMAXlower 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]>Signed-off-by WANG Cong <[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@@ -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