pid_max hang again...
Searching for a free pid value and inserting the thread into the task list should be atomic, otherwise the same pid value could be given to 2 threads.
do_fork runs without the BLK, you might have to search for the pid within the write_lock_irq(&tasklist_lock) block.
--
Manfred