• Ingo Molnar's avatar
    [PATCH] atomic-thread-signals · 5a5ec729
    Ingo Molnar authored
    Avoid racing on signal delivery with thread signal blocking in thread
    groups.
    
    The method to do this is to eliminate the per-thread sigmask_lock, and
    use the per-group (per 'process') siglock for all signal related
    activities.  This immensely simplified some of the locking interactions
    within signal.c, and enabled the fixing of the above category of signal
    delivery races.
    
    This became possible due to the former thread-signal patch, which made
    siglock an irq-safe thing.  (it used to be a process-context-only
    spinlock.) And this is even a speedup for non-threaded applications:
    only one lock is used.
    
    I fixed all places within the kernel except the non-x86 arch sections.
    Even for them the transition is very straightforward, in almost every
    case the following is sufficient in arch/*/kernel/signal.c:
    
    		:1,$s/->sigmask_lock/->sig->siglock/g
    5a5ec729
waitq.c 6.48 KB