Re: [Patch v4 1/2] freezer: check OOM kill while being frozen

From: Cong Wang
Date: Tue Sep 16 2014 - 18:55:54 EST

On Mon, Sep 15, 2014 at 2:36 AM, Michal Hocko <mhocko@xxxxxxx> wrote:
> This patch builds on top of Cong Wang's. What do you think?

I think it is should a preliminary of my patch, not a followup. I can carry
this patch for you if you want.

> ---
> From cdf97a20b107ee584352f07274a88d7c3f014ab2 Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@xxxxxxx>
> Date: Mon, 15 Sep 2014 10:52:30 +0200
> Subject: [PATCH] OOM, PM: OOM killed task cannot escape PM suspend
> PM freezer relies on having all tasks frozen by the time devices are
> getting frozen so that no task will touch them while they are getting
> frozen. But OOM killer is allowed to kill an already frozen task in
> order to handle OOM situtation. In order to protect from late wake ups
> OOM killer is disabled after all tasks are frozen. This, however, still
> keeps an window open when a killed task didn't manage to die by the time
> freeze_processes finishes. Fix this by checking all tasks after OOM
> killer has been disabled. To prevent from useless check also introduce
> and check oom_kills count which gets incremented when a task is killed
> by OOM killer. All the tasks have to be checked only if the counter
> changes.

Not sure if I understand your patch correctly, seems you are checking if
there is any ongoing OOM killer during PM suspend, since oom_kills
will always increase, maybe a seqlock is more clear?

Or you mean totally forbid PM suspend when an OOM killer is ongoing?
If so, you should call atomic_dec() after OOM is done.

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