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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 3ADF0C432C0 for ; Tue, 26 Nov 2019 15:06:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 079E72071E for ; Tue, 26 Nov 2019 15:06:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 079E72071E 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 953256B031E; Tue, 26 Nov 2019 10:06:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 902C96B031F; Tue, 26 Nov 2019 10:06:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 81AF56B0320; Tue, 26 Nov 2019 10:06:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id 6C83D6B031E for ; Tue, 26 Nov 2019 10:06:27 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 0CA70824999B for ; Tue, 26 Nov 2019 15:06:27 +0000 (UTC) X-FDA: 76198754814.24.duck69_726594006bb5d X-HE-Tag: duck69_726594006bb5d X-Filterd-Recvd-Size: 4926 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Tue, 26 Nov 2019 15:06:26 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id b11so3553628wmb.5 for ; Tue, 26 Nov 2019 07:06:25 -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=v5bhXZwNVxMTvpSeHbyc5UDisaRHe9tqAPCQyU8hkGE=; b=i2duNEZNo2RnsyDcw6O6LPc9+5Ot6t77p2jUiEh/exCEMUg74z6MT7bFFrvztQ0H75 noNjrP/3VFZFPCciP6w/D3QTxeS9q6zhMx3z93Gmnu0EdmoqCR/3R7ZcINzJ3Iu+XgvV mMJku2lTQA7EEzC0FDNO3NCvA6g/AhLERubI9BaM3aREg/7q2oBKQn5t/vTkIQTmUrEn kW/UuHJI33vGHAay6jCLEjRtmcRCtthac6QLFHxnQW8BUNbGXd+HbkwBa8ZNnPnEh7m4 NU3V4BtnnGTnaWiWCKMcEmoI+TCse2XPN6cN6jZvG2Omq65PM859yFbXI1Cc4u+HEkVH NRfQ== X-Gm-Message-State: APjAAAX7ev15eC6mIgQwJwZoYlVXe8xdxdBFcyaG5Ok5Z54XW8RKk47P P3bxgX5gW2qOoDFkLqQcTJ/RUhCV X-Google-Smtp-Source: APXvYqwzP0hXAWUqBfCdM89cSCW5jFU10z52IEUehitmBjXl+LvFBivsdHbBcfPadmUVnHuO7z7kYA== X-Received: by 2002:a7b:c7d5:: with SMTP id z21mr2178434wmk.77.1574780784971; Tue, 26 Nov 2019 07:06:24 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id o189sm3483921wmo.23.2019.11.26.07.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 07:06:24 -0800 (PST) Date: Tue, 26 Nov 2019 16:06:23 +0100 From: Michal Hocko To: Yafang Shao Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Linux MM Subject: Re: [PATCH] mm, memcg: avoid oom if cgroup is not populated Message-ID: <20191126150623.GI20912@dhcp22.suse.cz> References: <1574773369-1634-1-git-send-email-laoar.shao@gmail.com> <20191126131604.GF20912@dhcp22.suse.cz> <20191126144510.GH20912@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 22:51:30, Yafang Shao wrote: > On Tue, Nov 26, 2019 at 10:45 PM Michal Hocko wrote: > > > > On Tue 26-11-19 22:25:27, Yafang Shao wrote: > > > On Tue, Nov 26, 2019 at 9:16 PM Michal Hocko wrote: > > > > > > > > On Tue 26-11-19 08:02:49, 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 misleading outputs, that should not happen. > > > > > > > > I disagree that the output is misleading. Quite contrary, it provides a > > > > useful lead on the unreclaimable memory. > > > > > > > > > > We can show the unreclaimable memory independently, rather than print > > > the full oom output. > > > OOM killer is used to kill process, why do we invoke it when there's > > > no process ? > > > What's the advantage of doing it ? > > > > Consistency. > > > > If there are tasks, we invoke the OOM killer to try to kill the tasks. > If there're no tasks, we just try to free the reclaimable pages. The fact that the oom killer has been invoked implies there is _no_ reclaimable memory. Full stop. Anyway I am getting a bit tired to repeat myself so I am not continuing in this discussion. I have provided my feedback to your patch, please try to think harder about it. If you have real life usecases which cannot work properly with the existing functionality and APIs then bring them up. -- Michal Hocko SUSE Labs