From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E5D7C432C0 for ; Wed, 27 Nov 2019 08:54:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D081920665 for ; Wed, 27 Nov 2019 08:54:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D081920665 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 82F8D6B036D; Wed, 27 Nov 2019 03:54:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B91D6B036E; Wed, 27 Nov 2019 03:54:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 681576B036F; Wed, 27 Nov 2019 03:54:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id 4F65A6B036D for ; Wed, 27 Nov 2019 03:54:39 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 000955DD8 for ; Wed, 27 Nov 2019 08:54:38 +0000 (UTC) X-FDA: 76201446636.19.car77_7fdbfdbc34e16 X-HE-Tag: car77_7fdbfdbc34e16 X-Filterd-Recvd-Size: 4136 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Nov 2019 08:54:38 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id z7so22229858wrl.13 for ; Wed, 27 Nov 2019 00:54:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=BG3Oyvr6XT3aNN6yVEaA0DAH9TmnG6W6iVtfzNUia8s=; b=O0y6lkhUr3rjzPpLA3lYcngLgb0Kziz+esKevpF0AxMrboOW8/hAWCUHIvTVQRT0uQ wdewsfINEYjStCG7QHpHBsee823clr4BPIuFGr+Y4cjTT0s2SHSzoMsXg0rerTN2XL05 M/IG+L7n1ljn8rccztL/Lt8u+chqmweiaCaBNbtMxSZylPme9khrHjb6yrwBmvY83DmJ ouXSMGzJGvICnw4Qi5j8n8nHBR6KFbTVfZXJuqLn0OBfFG4cYVBtuSSoiOqvaxt4OruU Dv24XFG3yTtP2hl40a2G6/+ywJ7AI7LYw82zHy/y60Cr31lGj5KohFWTAnOBPu+05s0M 8GqA== X-Gm-Message-State: APjAAAU22CI7+MPKpBybZjeeiz/b/jSzz2ghEVYlD/ACd9DI2+971xGg ZStTjpH7Rl3hRovXm2uTDGIeoO0W X-Google-Smtp-Source: APXvYqxeAK//3Hg5woNxYdMIAFwjNsyywlz1acKeGfu5Lcj9eVU84ZQBfDsKkYnPRWKLrWUnKmyfXw== X-Received: by 2002:a5d:42d1:: with SMTP id t17mr40015774wrr.56.1574844877557; Wed, 27 Nov 2019 00:54:37 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id y8sm18659705wru.59.2019.11.27.00.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 00:54:36 -0800 (PST) Date: Wed, 27 Nov 2019 09:54:36 +0100 From: Michal Hocko To: Yafang Shao Cc: hannes@cmpxchg.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm, memcg: avoid oom if cgroup is not populated Message-ID: <20191127085436.GN20912@dhcp22.suse.cz> References: <1574818117-2885-1-git-send-email-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1574818117-2885-1-git-send-email-laoar.shao@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 26-11-19 20:28:37, Yafang Shao wrote: > There's one case that the processes in a memcg are all exit (due to OOM > group or some other reasons), but the file page caches are still exist. > These file page caches may be protected by memory.min so can't be > reclaimed. If we can't success to restart the processes in this memcg or > don't want to make this memcg offline, then we want to drop the file page > caches. > The advantage of droping this file caches is it can avoid the reclaimer > (either kswapd or direct) scanning and reclaiming pages from all memcgs > exist in this system, because currently the reclaimer will fairly reclaim > pages from all memcgs if the system is under memory pressure. > The possible method to drop these file page caches is setting the > hard limit of this memcg to 0. Unfortunately this may invoke the OOM killer > and generates lots of outputs, that should not happen. > The OOM output is not expected by the admin if he or she wants to drop > the cahes and knows there're no processes in this memcg. > > If memcg is not populated, we should not invoke the OOM killer because > there's nothing to kill. Next time when you start a new process and if the > max is still bellow usage, the OOM killer will be invoked and your new > process is killed, so we can cosider it as lazy OOM, that is we have been > always doing in the kernel. > > Fixes: b6e6edcf ("mm: memcontrol: reclaim and OOM kill when shrinking memory.max below usage") > Signed-off-by: Yafang Shao > Cc: Johannes Weiner > Cc: Michal Hocko due to reasons explained repeatedly Nacked-by: Michal Hocko And I really find it highly annoying that you keep ignoring the review feedback. -- Michal Hocko SUSE Labs