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=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no 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 BEB93C432C0 for ; Wed, 27 Nov 2019 09:34:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D915204FD for ; Wed, 27 Nov 2019 09:34:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pvVoYpiB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D915204FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 971356B0375; Wed, 27 Nov 2019 04:34:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9215E6B0376; Wed, 27 Nov 2019 04:34:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 837406B0377; Wed, 27 Nov 2019 04:34:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id 6C9916B0375 for ; Wed, 27 Nov 2019 04:34:24 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 26B78181AEF15 for ; Wed, 27 Nov 2019 09:34:24 +0000 (UTC) X-FDA: 76201546848.27.smell38_2660c468a931c X-HE-Tag: smell38_2660c468a931c X-Filterd-Recvd-Size: 5162 Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Nov 2019 09:34:23 +0000 (UTC) Received: by mail-il1-f195.google.com with SMTP id y16so12896393iln.0 for ; Wed, 27 Nov 2019 01:34:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n1GdYec33Ulannf9ams++7jGbbN33auHoKUYzzYugjg=; b=pvVoYpiBnQlsimT+qU+sL9rAztIoNbP0BaQZ8ahfDuolm3FaENHVvhWYSMGnuLWOua 1rfPY69Rq8Xqmyv5Kk4AbZyZg1P4RKCaksUcsEffhbteQAXE2yclr5/lajp6p9TozOxZ GLM7yadupd67I7BUM7vTe6FklzWyIpPqF2PiXrexTG9/y3km6EWbZKvl3Q6/E7xaF40/ NYtziHFTD5pOSC/PHDriShthfM4FgbmT4gLtnxwVMgk1w69ypbQSqp2yYT7YaujEDsU+ nF0S8PptVN6IINYD/LmXqyOAPpSflIQCD/SJYLnAIUtimiu8l+tCkVSekxA2rkCKgkCJ JH3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n1GdYec33Ulannf9ams++7jGbbN33auHoKUYzzYugjg=; b=Wx6aYQ9jXaXQmICgaqbUAZWvXlDOr/zReI4p6CqOKbOQ5mDEIc0cGGb7VHp22LbsDx NsVOrFaVb+QlQdZXQo5Nt8G/5nmfCEe62hE0Mbb9PH2AX09IXDnhrt2J/ivw16eTvQlF hVZiifepS9s9E8+2sYYIlDN6jhWkangR2DW5d5AhERGfMOAu8sYsnMbukYIYB83rU4e+ 2XWHVC8EZRM/FTHAIpBnwvjbiZspA12LZUN9OcFupO3bhmuS/5RzpKNX7Y8uI1QPh5I3 cIQYNRz2cud1BrM4ShM/UNsWB5BfbDgz/ciZ8SBYqCG+caGOZ4+KsvjaHCGFeOQg6UoQ JUMw== X-Gm-Message-State: APjAAAUwxCXD4+kGKJflODFrP9D6+06vfDHp1DEzn202qx6Dqz0R6Xkd GrBRwhpSyzwnqCkRdaKLgv2zMBUnGdjipw0T1uY= X-Google-Smtp-Source: APXvYqwgY3GUZUxs0U4v4snoTeDuL+wbk01fcil13AtojYfXH2wkYU+Y9PihvNIxG4AevWIM8A3NPBdGDn0hYvSbTZY= X-Received: by 2002:a92:46c8:: with SMTP id d69mr942942ilk.168.1574847263004; Wed, 27 Nov 2019 01:34:23 -0800 (PST) MIME-Version: 1.0 References: <1574818117-2885-1-git-send-email-laoar.shao@gmail.com> <20191127085436.GN20912@dhcp22.suse.cz> In-Reply-To: From: Yafang Shao Date: Wed, 27 Nov 2019 17:33:46 +0800 Message-ID: Subject: Re: [PATCH v2] mm, memcg: avoid oom if cgroup is not populated To: Michal Hocko Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Linux MM Content-Type: text/plain; charset="UTF-8" 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 Wed, Nov 27, 2019 at 5:17 PM Yafang Shao wrote: > > On Wed, Nov 27, 2019 at 4:54 PM Michal Hocko wrote: > > > > 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. > > I didn't ignore your feedback, pls. read my reply and commit log seriously. > The reason I didn't accept your freeback is that your freeback is > based on your wrong knowladge. > While Johannes really give me some useful feedback, Thanks Johannes ! Thanks Yafang