Merge tag 'kernel-6.15-rc1.tasklist_lock' of git://git.kernel.org/pub/scm/linux/kerne...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Mar 2025 20:39:27 +0000 (13:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Mar 2025 20:39:27 +0000 (13:39 -0700)
Pull tasklist_lock optimizations from Christian Brauner:
 "According to the performance testbots this brings a 23% performance
  increase when creating new processes:

   - Reduce tasklist_lock hold time on exit:
       - Perform add_device_randomness() without tasklist_lock
       - Perform free_pid() calls outside of tasklist_lock

   - Drop irq disablement around pidmap_lock

   - Add some tasklist_lock asserts

   - Call flush_sigqueue() lockless by changing release_task()

   - Don't pointlessly clear TIF_SIGPENDING in __exit_signal() ->
     clear_tsk_thread_flag()"

* tag 'kernel-6.15-rc1.tasklist_lock' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  pid: drop irq disablement around pidmap_lock
  pid: perform free_pid() calls outside of tasklist_lock
  pid: sprinkle tasklist_lock asserts
  exit: hoist get_pid() in release_task() outside of tasklist_lock
  exit: perform add_device_randomness() without tasklist_lock
  exit: kill the pointless __exit_signal()->clear_tsk_thread_flag(TIF_SIGPENDING)
  exit: change the release_task() paths to call flush_sigqueue() lockless

1  2 
kernel/exit.c
kernel/pid.c

diff --cc kernel/exit.c
@@@ -250,13 -249,13 +250,14 @@@ repeat
        dec_rlimit_ucounts(task_ucounts(p), UCOUNT_RLIMIT_NPROC, 1);
        rcu_read_unlock();
  
 +      pidfs_exit(p);
        cgroup_release(p);
  
+       thread_pid = get_pid(p->thread_pid);
        write_lock_irq(&tasklist_lock);
        ptrace_release_task(p);
-       thread_pid = get_pid(p->thread_pid);
-       __exit_signal(p);
+       __exit_signal(&post, p);
  
        /*
         * If we are the last non-leader member of the thread
diff --cc kernel/pid.c
Simple merge