Re: [pidhashing] [2/3] lower PID_MAX_LIMIT for 32-bit machines

William Lee Irwin III
2004-09-14T02:43:09Z

On Mon, Sep 13, 2004 at 07:31:14PM -0700, William Lee Irwin III wrote:
> /proc/ breaks when PID_MAX_LIMIT is elevated on 32-bit, so this patch
> lowers it there. Compiletested on x86-64.
[...]
> -#define PID_MAX_LIMIT (4*1024*1024)
> +#define PID_MAX_LIMIT (sizeof(long) > 32 ? 4*1024*1024 : PID_MAX_DEFAULT)

Index: mm5-2.6.9-rc1/include/linux/threads.h
===================================================================
--- mm5-2.6.9-rc1.orig/include/linux/threads.h 2004-08-13 22:36:12.000000000 -0700
+++ mm5-2.6.9-rc1/include/linux/threads.h 2004-09-13 19:30:47.552374432 -0700
@@ -30,6 +30,6 @@
/*
* A maximum of 4 million PIDs should be enough for a while:
*/
-#define PID_MAX_LIMIT (4*1024*1024)
+#define PID_MAX_LIMIT (sizeof(long) > 4 ? 4*1024*1024 : PID_MAX_DEFAULT)

#endif