I found 4 minor problems in the thread creation code: * 2.2 reserved 4 threads for root, and 2.4 still has the define (MIN_THREADS_LEFT_FOR_ROOT), but the code is missing :-( * get_pid causes a deadlock when all pid numbers are in use. In the worst case, only 10900 threads are required to exhaust the 15 bit pid space. * in theory, fork_init() might give 2 tasks the same pid, although this can only happen when all but 1 or 2 pids are in use: << fork_init() runs with the BKL acquired. It first calls get_pid(), and get_pid() internally scans the task queue and returns a pid number that is not used by a thread on the task queue. But it doesn't add the thread to the task queue. copy_xy() can sleep, thus the BKL is released. At the end of fork_init(), the new task is added to the task queue. --> if 2 thread are within fork_init(), then both might get the same pid! >>> * the spinlock within get_pid is bogus: get_pid isn't SMP safe. I've attached a patch (tested with 2.4.0-test12). -- Manfred