threads.h 943 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _LINUX_THREADS_H
  2. #define _LINUX_THREADS_H
  3. #include <linux/config.h>
  4. /*
  5. * The default limit for the nr of threads is now in
  6. * /proc/sys/kernel/threads-max.
  7. */
  8. /*
  9. * Maximum supported processors that can run under SMP. This value is
  10. * set via configure setting. The maximum is equal to the size of the
  11. * bitmasks used on that platform, i.e. 32 or 64. Setting this smaller
  12. * saves quite a bit of memory.
  13. */
  14. #ifdef CONFIG_SMP
  15. #define NR_CPUS CONFIG_NR_CPUS
  16. #else
  17. #define NR_CPUS 1
  18. #endif
  19. #define MIN_THREADS_LEFT_FOR_ROOT 4
  20. /*
  21. * This controls the default maximum pid allocated to a process
  22. */
  23. #define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
  24. /*
  25. * A maximum of 4 million PIDs should be enough for a while.
  26. * [NOTE: PID/TIDs are limited to 2^29 ~= 500+ million, see futex.h.]
  27. */
  28. #define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
  29. (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
  30. #endif