Re: kernel thread support - LWP's

Khimenko Victor (khim@sch57.msk.ru)
Mon, 19 Jul 1999 00:29:41 +0400 (MSD)


On Sun, 18 Jul 1999, Alan Cox wrote:

> > 2 context switches != 0 context switches :-(( When you want to create
> > 10000 inactive threads performace loss will be significant :-/
>
> 10,000 inactive threads is 10,000 8K stacks, ie 10,000 two page memory allocs
> a whole pile of other stuff too. I dont think it'll be that significant. I'd
> like to see the 10,000 thread application and the stats first.
>
Of course stats will help here but to understood problem you do not need
them. clone() works 3usecs, switch is 1usec (roughly). So any application
with gobs of thread-creation will suffer (for example any application
where new thread is created for new incoming packet). Thread creation will
be 6usecs insteads of 3usecs (3usecs to create thread, 1usec to switch
back to new thread, 1usec to switch back to creator and 1usec to switch
back to working thread) and the only benefit is some 20-40 bytes of
"bloat" removed from linux kernel ...

Of course you still need CLONE_PPID/CLONE_PPIDOK/PF_PPIDOK to eliminate
switch to "manager thread" altogether...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/