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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 DE64DC433E0 for ; Fri, 22 May 2020 15:52:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 926D12070A for ; Fri, 22 May 2020 15:52:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ecrd2p+Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 926D12070A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 298D180008; Fri, 22 May 2020 11:52:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 26ED980007; Fri, 22 May 2020 11:52:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 183C580008; Fri, 22 May 2020 11:52:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id F242680007 for ; Fri, 22 May 2020 11:52:26 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9773F180AD820 for ; Fri, 22 May 2020 15:52:26 +0000 (UTC) X-FDA: 76844797092.06.move41_6c9bf72bce142 X-HE-Tag: move41_6c9bf72bce142 X-Filterd-Recvd-Size: 5168 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 May 2020 15:52:26 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id c11so11058793ljn.2 for ; Fri, 22 May 2020 08:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pzV3LzaWpLqEQz7xrfeZadAQqncDoc1EoDALXRQg684=; b=ecrd2p+Z0xMZv/rR6DTAk5eHxnu75cCVZpIkVUiOxAmcn/uGpQ76fe/RdYBKnDGcNn usKsFYHUfc8IJCeFK9TCnwsZJ4fFoXwPZi38YsnLumjKeWClT6zb2dBkvWdrh8TjMOI9 8TtgdhQPEeNYdC3iQygERG3JLD9kJoFmJI7kU+y+UnuA8f/PWrbFeKevQIHrjaYjxt4U MmfN3Pife0Kp4EFyVi4c5qQrGPrdhfTRwHqE6Oj/xmUdmr8EnwGhaaScT9eN7b9A2E5R Zh3t5sJfRGMtIsUynAxujcjs1et1BKPZDN3OKbUGTRtl+OxOximszArRCkFy9E5vnuGQ FETQ== 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=pzV3LzaWpLqEQz7xrfeZadAQqncDoc1EoDALXRQg684=; b=dR327DNrqVqf1/P/YTiXN3gDliLf2xdsGEMud4outIu4AkLja0FfJsHZnysCar/d9F u4h9qjhFTIIf2mgWKn7fL2K+VHVCx6S+9PGa2wCpZOGD1VvmWI3bnGpJ7cQ/ceR8FiGR VLQBY0owFLtN5gXG044H55QGVd74YN56WG9yyIrSVcePDtNfYHsAKGt3mMwf/i/sMX8i EyCCTNDVwyyvov8JJFJlPXNW6Kl7j9C9eygvMhgB5fiCVeU2kV/ArPv14HqOeUcXG18F UtJq/VUZoR/qWue/fbhK51CA6UwTiveruU3DKvOLnXrym/7UE3YIHAMdyvVTNFf2ODdI Z2IA== X-Gm-Message-State: AOAM532KsRf/OwKRa4NqtCeqR91jUH2orOIS8C1wfdBeGDoTqk/4ZHNs oEiS8T7HzpEwNgV0OmOrJtTf6hD6Nx8KWx1ZTW6hGw== X-Google-Smtp-Source: ABdhPJyoOnv1UJQoinATeYtCls35JqiM0/st8sfeEGPkx4jFpRm7nah+R85ozQ/WMeV5DKPIZJHQuWiAHxtmBBAWgFc= X-Received: by 2002:a2e:9b4f:: with SMTP id o15mr5424550ljj.358.1590162744672; Fri, 22 May 2020 08:52:24 -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: Naresh Kamboju Date: Fri, 22 May 2020 21:22:13 +0530 Message-ID: Subject: Re: [PATCH v3 2/2] mm, memcg: Decouple e{low,min} state mutations from protection checks To: Yafang Shao , Andrew Morton Cc: 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.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. > > 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