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,URIBL_BLOCKED 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 CA76EC432C0 for ; Wed, 27 Nov 2019 09:17:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 882A02070A for ; Wed, 27 Nov 2019 09:17:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="o87czE1Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 882A02070A 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 2039C6B0371; Wed, 27 Nov 2019 04:17:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B4016B0373; Wed, 27 Nov 2019 04:17:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A3D46B0375; Wed, 27 Nov 2019 04:17:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id E83716B0371 for ; Wed, 27 Nov 2019 04:17:42 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 955BA6D96 for ; Wed, 27 Nov 2019 09:17:42 +0000 (UTC) X-FDA: 76201504764.11.burn64_262898d4dbe3a X-HE-Tag: burn64_262898d4dbe3a X-Filterd-Recvd-Size: 4830 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Nov 2019 09:17:42 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id i11so13101390ioi.12 for ; Wed, 27 Nov 2019 01:17:42 -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=Dj9TUuMqG//c5rIzgXzp/iyoYgNubvynSPVHDWDA8Jw=; b=o87czE1YBd13ajsjiRIyMrh46y1EWpQ8wFi2C5cEGTTB9Bky8i/mhOtJcxzl83ZDYL Ov0tgixq/Oogs/kC18euoe+NYnfPh626fPWRbFV1U4h/OMsMXhVaZFW6/6Kn/E82GruE oppjFVmKorXC8Z/8iTpiJVy3Vqy54X36+YhkaG1xyf4xPcqtvCYhwYsiiskWWbmv79Ys HktECnj5tf13kFqtjpLwmr1ef0VEdDKM2fAEPscG2OlA2O+cFuji9MlF1767vRE5eRA7 H/eUQmpXSU6JrTb0rjjLQWk6+UJwE+AACSsEiCTrJnTVz0BupbY25Syh63fxvs4HG4ES Wzbw== 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=Dj9TUuMqG//c5rIzgXzp/iyoYgNubvynSPVHDWDA8Jw=; b=tRafSkVLYkfHXFmJqgpETe8qqDBhyeOTJXaYvpzYdy+TN7PejHAIGz/9Ph3wX9hTwk vKQYK6tWJ0hKPvZyQ+P4TVoHuICSDrSZ2YMgRaqTuS01i0lIQdo/ysAwmVvKgstDnuSh NlT0WMm8F4jEOK1j4z/47SY9eAAI6kEJU6bCzbgAktRfT+yJEinV50jGeG2o8krCpazO 1BqtV/nB0INL0xWa95yNgvEUiU6L8395zOpjOtvw6gXSD++D9+ghhxefTRbKPO4b+fiJ iqjCoB+zMHaiK+yuRQejAHDPrz+x5sKTpvvKiSwO+8JDm7STNVxevROrzz7Kqv8YAyDM hM6g== X-Gm-Message-State: APjAAAUMo0egwpMQLutkh7SSHKt4lTAbk+OOlXcpkTehUNQuw9Cf191A TLwJW+tMi9B3RMtv4n+Ow9J9XjwsQgeh+WVCPKQ= X-Google-Smtp-Source: APXvYqy/N1CgV/TyoxxZrpKeV/nKdN3cfIjhBAI/siviZ9KreVMrswZOz3H3wHWw/GtG1e5F5ysoRratyiLNqNfyIKw= X-Received: by 2002:a5e:8d0f:: with SMTP id m15mr248656ioj.203.1574846261440; Wed, 27 Nov 2019 01:17:41 -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: <20191127085436.GN20912@dhcp22.suse.cz> From: Yafang Shao Date: Wed, 27 Nov 2019 17:17:05 +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 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. Thanks Yafang