Re: WARNING in try_charge

From: Michal Hocko
Date: Mon Aug 06 2018 - 15:46:04 EST


[CCing Greg - the email thread starts here
http://lkml.kernel.org/r/0000000000005e979605729c1564@xxxxxxxxxx]

On Mon 06-08-18 12:12:02, syzbot wrote:
> Hello,
>
> syzbot has tested the proposed patch and the reproducer did not trigger
> crash:

OK, this is reassuring. Btw Greg has pointed out this potential case
http://lkml.kernel.org/r/xr93in62jy8k.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx
but I simply didn't get what he meant. He was suggesting MMF_OOM_SKIP
but I didn't get why that matters. I didn't think about a race.

So how about this patch: