[lkml]   [2007]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFC PATCH 1/2] Fix PF_NOFREEZE and freezeable race
    On 04/19, Rafael J. Wysocki wrote:
    > On Thursday, 19 April 2007 14:02, Gautham R Shenoy wrote:
    > > This patch fixes the race pointed out by Oleg Nesterov.
    > >
    > > * Freezer marks a thread as freezeable.
    > > * The thread now marks itself PF_NOFREEZE causing it to
    > > freeze on calling try_to_freeze(). Thus the task is frozen, even though
    > > it doesn't want to.
    > > * Subsequent thaw_processes() will also fail to thaw the task since it is
    > > marked PF_NOFREEZE.
    > >
    > > Avoid this problem by checking the current task's PF_NOFREEZE status in the
    > > refrigerator before marking current as frozen.
    > >
    > > Signed-off-by: Gautham R Shenoy <>
    > Looks good, although I'm not sure if we don't need to call recalc_sigpending()
    > for tasks that turn out to be PF_NOFREEZE.

    I agree, we should clear TIF_SIGPENDING. It is not so critical for user-space
    tasks, but for the kernel thread it may remain pending forever, causing subtle

    Gautham, isn't it possible to make a more simpler patch ? Just add PF_NOFREEZE
    check to frozen_process,

    static inline void frozen_process(struct task_struct *p)
    if (!unlikely(current->flags & PF_NOFREEZE)) {
    p->flags |= PF_FROZEN;
    clear_tsk_thread_flag(p, TIF_FREEZE);



    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-04-20 20:05    [W:0.020 / U:5.532 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site