git: kernel - Don't block in tstop() with locks held

Matthew Dillon dillon at crater.dragonflybsd.org
Wed May 29 22:35:41 PDT 2019


commit ba69e3575bf077f1f9b6a38b9bf6782025f1b8e9
Author: Matthew Dillon <dillon at backplane.com>
Date:   Wed May 29 14:33:07 2019 -0700

    kernel - Don't block in tstop() with locks held
    
    * There are several places where the kernel improperly blocks on a
      STOP signal while locks might be held.  This is a particular problem
      when PCATCH is specified e.g. in the middle of the NFS code.  It is
      meant to catch INTR but it also improperly allowed STOP to function
      and left the vnode lock held.
    
      Several other places in the kernel also use PCATCH and don't expect
      the kernel to actually block indefinitely on a STOP.
    
    * Don't block in STOP in these situations.  Simply mark the thread as
      stopped and wait until it tries to return to userland before actually
      stopping.
    
      Any kernel subsystems which desire to act on the STOP in-line instead
      of upon return to userland can do so manually, as long as they release
      all locks for the duration.

Summary of changes:
 sys/kern/kern_exit.c |  2 ++
 sys/kern/kern_sig.c  | 35 +++++++++++++++++++++++++++++------
 2 files changed, 31 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ba69e3575bf077f1f9b6a38b9bf6782025f1b8e9


-- 
DragonFly BSD source repository


More information about the Commits mailing list