2013年8月28日星期三

threads.h pid maximum of about a program

Procedures are as follows :

/*
* 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))


Will CONFIG_BASE_SMALL? 0x1000: 0x8000 What does it mean ? CONFIG_BASE_SMALL What ?
------ Solution ---------------------------------------- ----
CONFIG_BASE_SMALL - this should be as small memory / embedded devices to use, open the options section of the core kernel data structures will use the smaller value , and therefore take up less memory.

Reference : http://www.spinics.net/lists/newbies/msg39782.html

For # define PID_MAX_DEFAULT (CONFIG_BASE_SMALL? 0x1000: 0x8000)
this particular example, which is the show that opened CONFIG_BASE_SMALL , the biggest pid 0x1000 is only allowed to 4K, and the default is 0x8000 is 32K.

seemingly never able to see the system open CONFIG_BASE_SMALL this option ( you can look at your kernel config file used for confirmation ) .
------ For reference only -------------------------------------- -
also found in my machine cat / proc / sys / kernel / pid_max was 32768 ie 0x8000
------ For reference only --------- ------------------------------


grep find CONFIG_BASE_SMALL = 0, Thank you !

没有评论:

发表评论