• Rafael J. Wysocki's avatar
    Freezer: Introduce PF_FREEZER_NOSIG · ebb12db5
    Rafael J. Wysocki authored
    The freezer currently attempts to distinguish kernel threads from
    user space tasks by checking if their mm pointer is unset and it
    does not send fake signals to kernel threads.  However, there are
    kernel threads, mostly related to networking, that behave like
    user space tasks and may want to be sent a fake signal to be frozen.
    
    Introduce the new process flag PF_FREEZER_NOSIG that will be set
    by default for all kernel threads and make the freezer only send
    fake signals to the tasks having PF_FREEZER_NOSIG unset.  Provide
    the set_freezable_with_signal() function to be called by the kernel
    threads that want to be sent a fake signal for freezing.
    
    This patch should not change the freezer's observable behavior.
    Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
    Acked-by: default avatarPavel Machek <pavel@suse.cz>
    Signed-off-by: default avatarLen Brown <len.brown@intel.com>
    ebb12db5
kthread.c 7.21 KB