Re: [PATCH 12/16] freezer: clean up freeze_processes() failure path

From: Oleg Nesterov
Date: Sun Aug 28 2011 - 14:12:33 EST


On 08/19, Tejun Heo wrote:
>
> void __thaw_task(struct task_struct *p)
> {
> unsigned long flags;
> @@ -150,11 +135,19 @@ void __thaw_task(struct task_struct *p)
> * be visible to @p as waking up implies wmb. Waking up inside
> * freezer_lock also prevents wakeups from leaking outside
> * refrigerator.
> + *
> + * If !FROZEN, @p hasn't reached refrigerator, recalc sigpending to
> + * avoid leaving dangling TIF_SIGPENDING behind.
> */
> spin_lock_irqsave(&freezer_lock, flags);
> clear_freeze_flag(p);
> - if (frozen(p))
> + if (frozen(p)) {
> wake_up_process(p);
> + } else {
> + spin_lock(&p->sighand->siglock);
> + recalc_sigpending_and_wake(p);

This was copied from cancel_, yes. but what this
recalc_sigpending_and_wake() can or should do?

It looks simply pointless. It can't clear TIF_SIGPENDING,
it can only do the unneeded/spurious wake_up(INTERRUPTIBLE).

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/