Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp385223ybr; Fri, 22 May 2020 08:54:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL8+vKqTFVOiZ7XYtAuZ/xe1aXKFpSdDyT4Eat8PiQkgk6W6v90MDSEMkReAdmXErpbc8p X-Received: by 2002:a05:6402:1adc:: with SMTP id ba28mr3455821edb.14.1590162868220; Fri, 22 May 2020 08:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590162868; cv=none; d=google.com; s=arc-20160816; b=Jh/+TJemLJ7FQOWoa942kt5ivk/MEHKDqrZJvLhIOFGA8lt45qbGBJLzpD59HNEObs r69oufCRvqxXytHC4FkIYTc4Sd/wyMBxdxan4QaMYxwdF3uyaQTJY401pusH9nCCKj+6 X91blsHK02igo2iAAN04CJekpWrPx4+7man1faMwS0ERuaQqBlTWr9/aJsBHke/2OocX 75HjJCLWpHu4Quv9e91IE4hkAdUMebtp0bdU/33ZS/dRYhVoYahkm7v5jiKjustTRp+u MRDiD5fEHYeZeio8CGU3zjDCoZ5H93Z64gu3DDmyo5D7i6wWZfJQu5cNfDHzpgElgcRl Q/2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=pzV3LzaWpLqEQz7xrfeZadAQqncDoc1EoDALXRQg684=; b=Nh2buWVaJHKFUmF1SnsBFBnOZzd8g9EI3mflGD8/b5BXNrbpAWdIIxlqhSzh/j50Uu 5+THaXYHMMXe+UkK2TAnb4sb+LfIL1wHDT0rHXjZVvv+cGfjW6Ri7BUxLney2hU136cR wEaWlRnT7X6AOIQM+8SVD3E1o30ZChjfqJPNeJNzU1SknqtfKpsSRDR7tbUlGfc7SiFw w3yX0sxeGItdxTKrmo2uYKGF5qmbOwgdnDZuOkX3yCiy5/9UzhRIUpBsI17jSqIvbnZH 78PfHp0RFop4h/QYdJsgGzr7URk7dThKpbh4Xq05vTq7suzaNrESTlsB+sAzYqSS9ltN bnXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ecrd2p+Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si4781568edt.104.2020.05.22.08.54.05; Fri, 22 May 2020 08:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ecrd2p+Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730397AbgEVPw2 (ORCPT + 99 others); Fri, 22 May 2020 11:52:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730181AbgEVPw1 (ORCPT ); Fri, 22 May 2020 11:52:27 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55C7DC061A0E for ; Fri, 22 May 2020 08:52:26 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id z18so13165562lji.12 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=Fr5igbauhwlVQLlyFXyhQtXDGOmudkNk1GETQDErtgvrdPj/tuKcQwx00Fxy57XJtO P6y+SuRhinwuEBizHUggRPRDwpvE6vHhG3ux++lmSzvB5e/qPR0cj2k8v2w3lrjFBnKV Mh5J12ulqdI5prMCWMryGPqLi1ifHY4kzz30XPhrPlbXjCm9RoXFCxwUJ9d2JasSWU6u CbYNatIeU0l6WtvaalXyaTE82MFnW/NAbrAuqwGu0qCftst/Ntj0n6HIoCPe3LpZgiQy a9eoDLfDLjaJscSd9LCJC36+9v+UkWn51kFIWFOC7ja+CpX6ZF7eOx0Gn7UZTfeqH5z2 Dffw== X-Gm-Message-State: AOAM5338iadOrVnpX1REsOo4yHCCwEzVUqeUZPgumC9Huoh9zOAUh9el K50X1dlsbU9hSYSndso8KPTTgguK+QiHbttH/dmyqw== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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