Skip to contentSkip to conversation

PATCH: 2.5.40 sane minimum proc count

DISCUSSION Matthew Wilcox 2 participants 2 messages Oct 7, 2002

lore
Share & tools
lore
#0 lore raw
        max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;

- init_task.rlim[RLIMIT_NPROC].rlim_cur = max_threads/2;
- init_task.rlim[RLIMIT_NPROC].rlim_max = max_threads/2;
+ /*
+ * we need to allow at least 10 threads to boot a system
+ */
+ init_task.rlim[RLIMIT_NPROC].rlim_cur = max(10, max_threads/2);
+ init_task.rlim[RLIMIT_NPROC].rlim_max = max(10, max_threads/2);

why not simply:

	max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;

+ /* we need to allow at least 20 threads to boot a system */
+ if (max_threads < 20)
+ max_threads = 20;
+

	init_task.rlim[RLIMIT_NPROC].rlim_cur = max_threads/2;
	init_task.rlim[RLIMIT_NPROC].rlim_max = max_threads/2;

i think we're going to see more kernel threads with 2.5 than we did with 2.4; let's be safer.

Signature · 1 line
Revolutions do not require corporate support.
#1 lore raw
Quoted 11 lines · Matthew Wilcox

why not simply:

	max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;
(quoted diff) +4 -0
+	/* we need to allow at least 20 threads to boot a system */
+	if (max_threads < 20)
+		max_threads = 20;
+
	init_task.rlim[RLIMIT_NPROC].rlim_cur = max_threads/2;
	init_task.rlim[RLIMIT_NPROC].rlim_max = max_threads/2;
Quoted 2 lines

i think we're going to see more kernel threads with 2.5 than we did with 2.4; let's be safer.

Much better, will switch