lkml.org 
[lkml]   [2002]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch] lockless, scalable get_pid(), for_each_process() elimination, 2.5.35-BK

On Wed, 18 Sep 2002, Andries Brouwer wrote:
>
> Please leave pid_max large.

I have to agree.

There is no goodness in making life complicated, and then putting a lot of
effort in solving that complexity with other complexity.

I would suggest something like this:
- make pid_max start out at 32k or whatever, to make "ps" look nice if
nothing else.
- every time we have _any_ trouble at all with looking up a new pid, we
double pid_max.

And it's really easy to recognize trouble with something truly trivial
like the appended.

Give me one reason for why these two added lines aren't better than all
the complexity we've discussed? I can pretty much _guarantee_ that it's
faster, and it sure as hell is simpler. And all traditional uses that has
less than a few thousand threads at most will never see the larger pids,
so people can stare at "ps" output without going blind - the big pids
start showing up only on boxes that might actually _need_ them.

Linus

----
--- 1.77/kernel/fork.c Sun Sep 15 11:01:39 2002
+++ edited/fork.c Wed Sep 18 09:11:43 2002
@@ -175,6 +175,8 @@

if (last_pid >= next_safe) {
inside:
+ if (nr_threads > pid_max >> 4)
+ pid_max <<= 1;
next_safe = pid_max;
read_lock(&tasklist_lock);
repeat:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.276 / U:39.024 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site