Re: kthread, signals and PF_FREEZE (suspend)

From: Rusty Russell
Date: Sun Feb 15 2004 - 22:45:05 EST


In message <1076890731.5525.31.camel@xxxxxxxxxxxxxxxxxx> you write:
> Hi,
>
> I was wondering, has kthread been tested with the suspend code?

No, it hasn't.

> When trying to freeze the processes the suspend code sets PF_FREEZE on a
> process and calls signal_wake_up(p, 0);
>
> That means that signal_pending() will return true for that process which
> will make kthread stop the thread.

Yes, the way they are currently coded. I had assumed that spurious
signals do not occur.

> The workqueues have PF_IOTHREAD set and I'm only seeing those on my
> machine that's why it doesn't fail.
>
> But the migration threads for example call signal_pending() directly
> after schedule() before checking PF_FREEZE and calling refrigerator()
> (which BTW flushes all signals).

This will only happen on SMP systems with > 1 cpu though? I don't
think suspend works there anyway.

However, ksoftirqd will die I think: that will hurt if lots of irqs
come in.

Pavel, what is the answer here? Should the refrigerator code be in
the kthread infrastructure? Why does the workqueue code set
PF_IOTHREAD?

Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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/