Re: [PATCH 02/10] freezer: skip waking up tasks withPF_FREEZER_SKIP set

From: Oleg Nesterov
Date: Tue Apr 30 2013 - 13:14:37 EST


On 04/29, Colin Cross wrote:
>
> @@ -46,10 +46,10 @@ static int try_to_freeze_tasks(bool user_only)
> todo = 0;
> read_lock(&tasklist_lock);
> do_each_thread(g, p) {
> - if (p == current || !freeze_task(p))
> + if (p == current || freezer_should_skip(p))
> continue;
>
> - if (!freezer_should_skip(p))
> + if (freeze_task(p))
> todo++;

What if we race with freezer_count() ?

try_to_freeze_tasks() can wrongly succeed leaving the running task
unfrozen, no?

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/