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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 76D64C433DF for ; Fri, 22 May 2020 15:59:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 327A22089D for ; Fri, 22 May 2020 15:59:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iX98S1WG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 327A22089D 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 C092780008; Fri, 22 May 2020 11:59:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B934980007; Fri, 22 May 2020 11:59:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A5B1B80008; Fri, 22 May 2020 11:59:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 887CF80007 for ; Fri, 22 May 2020 11:59:46 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 46B5C180AD817 for ; Fri, 22 May 2020 15:59:46 +0000 (UTC) X-FDA: 76844815572.27.sofa88_1b0e485e0e205 X-HE-Tag: sofa88_1b0e485e0e205 X-Filterd-Recvd-Size: 5528 Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 May 2020 15:59:45 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id k18so11912641ion.0 for ; Fri, 22 May 2020 08:59:45 -0700 (PDT) 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=jtPsqd22g3xbib6xneI+Ag2OgkbCbIH9D8ABYL46yvQ=; b=iX98S1WGX0zPid+2GXhESW1748JtgtC//+o9Z1F8m/xa5JKbz+Xyp5/HEm3s+HscxF PgYK8FIamFK3CI58sGojA9grfQvJZFnP9ya0ZoF5K4tTa6/xzRJMIdxyTCENI3GdOoDh 5zW/tbDQNIHSibqa3CRDg6aEZXrK2m+DmkHRGip9WLbfKWWeEuesPxQup+wQDdzGHCtX FX5w21SF6Ba8f/5juYPYHOwSoy7ijAt1xiGYhc1ZavjgL8/W2sP8mvOHKjwEMav5S+D+ WHwQ5eKEygwvlcO26ca3Ir7ykZ1XlL1DRq2jZ/p6dmIyE2Cy7ofcSXkZvqFLg3hwYr77 nDmA== 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=jtPsqd22g3xbib6xneI+Ag2OgkbCbIH9D8ABYL46yvQ=; b=VOPYqWEgsgNZv0/h4CvCvEy7GQm9kfDLFsSwDaharbWA2YkEAfMP3TFD2mmO6ClQqf v4TvPQje5mVkwoljSlfBVbhVEHSH2u8risMg9xbDs39YnCPqOIt34fUaB3EcVkgjLhdl Ja2a7XPl1QZroRzqzPxV4Eeg9cJDhT3lQdGUX484cGXvrYi7aF+Z8TxhKAZPRrE1NZaM IAZlEftaZG978+AvfCfRzOVNKdHJW0pMzG9RPKd/1nVE3jq7ZrlF9p/OEU5Ft6vWwlHg NhUOyaz0rZzkSF02syqlZlb+30FuiH/n41h+P70wYG+v7tB66wj3K4F/8CR62tEUULxT B6/w== X-Gm-Message-State: AOAM532uucdl/J4FacO1iFiogLR2RliOT948TbPVMpPXs8LmbmMzpfG6 pw9z/oOlZs0p0ReKuWH6mQV2UHsxvB/+vMLohjE= X-Google-Smtp-Source: ABdhPJwEADjPyPpOhtgfkIVLI9+BWB8R/8zf8Ln6JidFocTsi9UCdU026PUhwWp0FEIDIdvlr24GL48qnx64PVlZdiY= X-Received: by 2002:a02:212c:: with SMTP id e44mr8556443jaa.109.1590163185281; Fri, 22 May 2020 08:59:45 -0700 (PDT) MIME-Version: 1.0 References: <20200505084127.12923-1-laoar.shao@gmail.com> <20200505084127.12923-3-laoar.shao@gmail.com> In-Reply-To: From: Yafang Shao Date: Fri, 22 May 2020 23:59:09 +0800 Message-ID: Subject: Re: [PATCH v3 2/2] mm, memcg: Decouple e{low,min} state mutations from protection checks To: Naresh Kamboju Cc: Andrew Morton , Chris Down , Michal Hocko , Johannes Weiner , Roman Gushchin , linux-mm , Cgroups , open list , lkft-triage@lists.linaro.org 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 Fri, May 22, 2020 at 11:52 PM Naresh Kamboju wrote: > > On Fri, 22 May 2020 at 17:49, Yafang Shao wrote: > > > > On Fri, May 22, 2020 at 7:01 PM Naresh Kamboju > > wrote: > > > > > > On Tue, 5 May 2020 at 14:12, Yafang Shao wrote: > > > > > > > > From: Chris Down > > > > > > > > mem_cgroup_protected currently is both used to set effective low and min > > > > and return a mem_cgroup_protection based on the result. As a user, this > > > > can be a little unexpected: it appears to be a simple predicate function, > > > > if not for the big warning in the comment above about the order in which > > > > it must be executed. > > > > > > > > This change makes it so that we separate the state mutations from the > > > > actual protection checks, which makes it more obvious where we need to be > > > > careful mutating internal state, and where we are simply checking and > > > > don't need to worry about that. > > > > > > This patch is causing oom-killer while running mkfs -t ext4 on i386 kernel > > > running on x86_64 machine version linux-next 5.7.0-rc6-next-20200521. > > > > > > > Hi Narash, > > > > Thanks for your report. > > My suggestion to the issue found by you is reverting this bad commit. > > Thanks for giving details on this problem. > I am not sure who will propose reverting this patch on the linux-next tree. > Please add Reported-by if it is sane. > I will do it. If no one has objection to my proposal, I will send it tomorrow. > > > > As I have explained earlier in another mail thread [1] that the usage > > around memcg->{emin, elow} is very buggy. > > We shouldn't use memcg->{emin, elow} in the reclaim context directly, > > because these two values can be modified by many reclaimers, so the > > good usage of it is storing the protection value into the > > scan_control. IOW, different reclaimers have different protection. > > But unfortunately my suggestion is ignored. > > > > We can set them to 0 before using them to workaround the issue found > > by you, but the fact is that we will introduce a new issue once we fix > > an old issue. > > > > [1]. https://lore.kernel.org/linux-mm/20200425152418.28388-1-laoar.shao@gmail.com/ > > > - Naresh -- Thanks Yafang