From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752379AbcFVMIs (ORCPT ); Wed, 22 Jun 2016 08:08:48 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35820 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbcFVMIq (ORCPT ); Wed, 22 Jun 2016 08:08:46 -0400 Date: Wed, 22 Jun 2016 14:08:43 +0200 From: Michal Hocko To: Tetsuo Handa Cc: linux-mm@kvack.org, rientjes@google.com, oleg@redhat.com, vdavydov@parallels.com, mgorman@techsingularity.net, hughd@google.com, riel@redhat.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: mm, oom_reaper: How to handle race with oom_killer_disable() ? Message-ID: <20160622120843.GE9208@dhcp22.suse.cz> References: <201606220032.EGD09344.VOSQOMFJOLHtFF@I-love.SAKURA.ne.jp> <20160621174617.GA27527@dhcp22.suse.cz> <201606220647.GGD48936.LMtJVOOOFFQFHS@I-love.SAKURA.ne.jp> <20160622064015.GB7520@dhcp22.suse.cz> <20160622065016.GD7520@dhcp22.suse.cz> <201606221957.DBC18723.LOFQSMHVJOFFOt@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606221957.DBC18723.LOFQSMHVJOFFOt@I-love.SAKURA.ne.jp> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 22-06-16 19:57:17, Tetsuo Handa wrote: > Michal Hocko wrote: [...] > > That being said I guess the patch to try_to_freeze_tasks after > > oom_killer_disable should be simple enough to go for now and stable > > trees and we can come up with something less hackish later. I do not > > like the fact that oom_killer_disable doesn't act as a full "barrier" > > anymore. > > > > What do you think? > > I'm OK with calling try_to_freeze_tasks(true) again for Linux 4.6 and 4.7 kernels. OK, I will resend the patch CC Rafael and stable. > But if free memory is little such that oom_killer_disable() can not expect TIF_MEMDIE > threads to clear TIF_MEMDIE by themselves (and therefore has to depend on the OOM > reaper to clear TIF_MEMDIE on behalf of them after the OOM reaper reaped some memory), > subsequent operations would be as well blocked waiting for an operation which cannot > make any forward progress because it cannot proceed with an allocation. Then, > oom_killer_disable() returns false after some timeout (i.e. "do not try to suspend > when the system is almost OOM") will be a safer reaction. Yes that is exactly what I meant by "oom_killer_disable has to give up" alternative. pm suspend already has a notion of timeout for back off and oom_killer_disable can use wait_even_timeout. But let's do that separately. -- Michal Hocko SUSE Labs