mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH]include/linux/threads.h : Removes extra checking CONFIG_BASE_SMALL
@ 2008-06-18 10:57 Rakib Mullick
  0 siblings, 0 replies; 3+ messages in thread
From: Rakib Mullick @ 2008-06-18 10:57 UTC (permalink / raw)
  To: mingo, arjan; +Cc: linux-kernel

In existing code for defining PID_MAX_DEFAULT and PID_MAX_LIMIT,a check for
CONFIG_BASE_SMALL has been made twice. This patch reduces an extra checking.


Signed-off-by: Md.Rakib H. Mullick ( rakib.mullick@gmail.com)

--- linux-2.6.25/include/linux/threads.h.orig	2008-06-16
11:46:42.000000000 +0600
+++ linux-2.6.25/include/linux/threads.h	2008-06-17 19:41:19.462424632 +0600
@@ -24,13 +24,17 @@
 /*
  * This controls the default maximum pid allocated to a process
  */
-#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
-
 /*
  * A maximum of 4 million PIDs should be enough for a while.
  * [NOTE: PID/TIDs are limited to 2^29 ~= 500+ million, see futex.h.]
  */
-#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
-	(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
+#if (CONFIG_BASE_SMALL)
+#define PID_MAX_DEFAULT 	0x1000
+#define PID_MAX_LIMIT 		(PAGE_SIZE * 8)
+#else
+#define PID_MAX_DEFAULT        	0x8000
+#define PID_MAX_LIMIT (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)
+#endif
+

 #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH]include/linux/threads.h : Removes extra checking CONFIG_BASE_SMALL
  2008-06-18 10:17 Rakib Mullick
@ 2008-06-18 11:40 ` Ingo Molnar
  0 siblings, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2008-06-18 11:40 UTC (permalink / raw)
  To: Rakib Mullick; +Cc: mingo, arjan, linux-kernel


* Rakib Mullick <rakib.mullick@gmail.com> wrote:

> In existing code for defining PID_MAX_DEFAULT and PID_MAX_LIMIT,a 
> check for CONFIG_BASE_SMALL has been made twice. This patch reduces an 
> extra checking.

hm, why should we do this change? The compiler will optimize away the 
check and it's cleaner without an extra #ifdef.

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH]include/linux/threads.h : Removes extra checking CONFIG_BASE_SMALL
@ 2008-06-18 10:17 Rakib Mullick
  2008-06-18 11:40 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Rakib Mullick @ 2008-06-18 10:17 UTC (permalink / raw)
  To: mingo, arjan; +Cc: linux-kernel

In existing code for defining PID_MAX_DEFAULT and PID_MAX_LIMIT,a check for
CONFIG_BASE_SMALL has been made twice. This patch reduces an extra checking.


Signed-off-by: Md.Rakib H. Mullick ( rakib.mullick@gmail.com)

--- linux-2.6.25/include/linux/threads.h.orig	2008-06-16
11:46:42.000000000 +0600
+++ linux-2.6.25/include/linux/threads.h	2008-06-17 19:41:19.462424632 +0600
@@ -24,13 +24,17 @@
 /*
  * This controls the default maximum pid allocated to a process
  */
-#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
-
 /*
  * A maximum of 4 million PIDs should be enough for a while.
  * [NOTE: PID/TIDs are limited to 2^29 ~= 500+ million, see futex.h.]
  */
-#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
-	(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
+#if (CONFIG_BASE_SMALL)
+#define PID_MAX_DEFAULT 	0x1000
+#define PID_MAX_LIMIT 		(PAGE_SIZE * 8)
+#else
+#define PID_MAX_DEFAULT        	0x8000
+#define PID_MAX_LIMIT (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)
+#endif
+

 #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-18 11:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-18 10:57 [PATCH]include/linux/threads.h : Removes extra checking CONFIG_BASE_SMALL Rakib Mullick
  -- strict thread matches above, loose matches on Subject: below --
2008-06-18 10:17 Rakib Mullick
2008-06-18 11:40 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®