Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1455105pxb; Wed, 20 Oct 2021 05:35:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7NxSlF3+ZifVZ72XuL/aTWdIeI7+3xJue76w9qdbSQbWP1Ig+pq+Fj7eAeM/nz5EqBgLc X-Received: by 2002:a05:6a00:c8c:b0:44d:c583:9b45 with SMTP id a12-20020a056a000c8c00b0044dc5839b45mr6082736pfv.28.1634733320144; Wed, 20 Oct 2021 05:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634733320; cv=none; d=google.com; s=arc-20160816; b=mBYmGIRapxEtp+RXOi6pFGt5uShZS8XaiD8fFW72VWfwvzdtJAnMXCH2/wy9I/7DLQ KBUEm+/qrxbqgNJugSe1m8No5b6Lt565onYEQ90FxyyF+ZFZsa4aYsSv54kFPEwnzymb 0qikJBfsjdOUmO59ADyZB2ixTslRuSUD7Qlt6jVmsP8Xna+OrRBD+ndRegv1e0UcDbHP 64ou4KTeog9p7P1VNevfDUKiYRXMDkt3YyZmcef1JNXlCVTfMLaEJgUiNJ62p5YmJhPY +Dg90zBfmqr6cvHWFonUTWdPV+TejRj+qg3Vr8KJ1AMQgb3aA4AlG4QMc3qz4TkQVZzL OEIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3UnTu9zwwf8NSgpDXIex/EQbixB3GG5nxeC27rFUoo4=; b=ZaCiVGBjTTOA19p3RTvseha9RdhDDDUOWTEwhtmH2UvYgMrfOFovhaZgPQhExlJTFl D3fTt1ViC8ppZr235rInvtTUbXjJGa3VOn4qu4mmcNWGqX52VoZ6JtQpdyTwKKjlBDbw leW5c9WDG4GHQdGfZREkqHz89Ui9VuXC4vDJSD/b+QKsGzXguzC5YXNlc5shmw+skpif y2y1c5rP30nAgNX46dFHz7s2hPnraJiOZW1wxHCP3MH+Pu5m1AY/5RwKe83Nz0q58tcc yN+omJ14j/7pZ3CdNTrv3JspARzuALpGgGgg80ft6vaBZdTZn9ehcBHWntXOvSf2uKHl OVxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=hwW3FoF7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o17si2961483plg.408.2021.10.20.05.35.07; Wed, 20 Oct 2021 05:35:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=hwW3FoF7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230182AbhJTMgD (ORCPT + 99 others); Wed, 20 Oct 2021 08:36:03 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:32988 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbhJTMgD (ORCPT ); Wed, 20 Oct 2021 08:36:03 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id DEDB81F770; Wed, 20 Oct 2021 12:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634733227; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3UnTu9zwwf8NSgpDXIex/EQbixB3GG5nxeC27rFUoo4=; b=hwW3FoF7Q9xQQ6c9C6pXKQVXDvbM5O97PBXyMbMq/0FtzqbRYEDMmNIeYhYMEUaH3bEmzm e2K72qTnlyNHrXAyZr3ANBJ4k6blJ6/7Ec3Cat8TdGd6Dwmgwtco8FNx3KQ/ipePD4qRPB QWwPiXvrmlfaVryc15mzcCx4y1j93vs= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 52F47A3C5F; Wed, 20 Oct 2021 12:33:47 +0000 (UTC) Date: Wed, 20 Oct 2021 14:33:43 +0200 From: Michal Hocko To: Vasily Averin Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Roman Gushchin , Uladzislau Rezki , Vlastimil Babka , Shakeel Butt , Mel Gorman , Tetsuo Handa , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@openvz.org Subject: Re: [PATCH memcg 1/3] mm: do not firce global OOM from inside dying tasks Message-ID: References: <2c13c739-7282-e6f4-da0a-c0b69e68581e@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c13c739-7282-e6f4-da0a-c0b69e68581e@virtuozzo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org s@firce@force@ On Wed 20-10-21 15:12:19, Vasily Averin wrote: > There is no sense to force global OOM if current task is dying. This really begs for much more information. Feel free to get an inspiration from my previous attempt to achieve something similar. In minimum it is important to mention that the OOM killer is already handled at the page allocator level for the global OOM and at the charging level for the memcg one. Both have much more information about the scope of allocation/charge request. This means that either the OOM killer has been invoked properly and didn't lead to the allocation success or it has been skipped because it couldn't have been invoked. In both cases triggering it from here is pointless and even harmful. Another argument is that it is more reasonable to let killed task die rather than hit the oom killer and retry the allocation. > Signed-off-by: Vasily Averin > --- > mm/oom_kill.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 831340e7ad8b..1deef8c7a71b 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -1137,6 +1137,9 @@ void pagefault_out_of_memory(void) > if (mem_cgroup_oom_synchronize(true)) > return; > > + if (fatal_signal_pending(current)) > + return; > + > if (!mutex_trylock(&oom_lock)) > return; > out_of_memory(&oc); > -- > 2.32.0 -- Michal Hocko SUSE Labs