Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1556318ybt; Thu, 18 Jun 2020 11:25:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcv2W+2HX03EA+0Ca7rgntdXvFG4xHJ29MxJ1KQ34faozPxzHzL8tQKEGdfVm5DzxcYkDv X-Received: by 2002:a50:b0c3:: with SMTP id j61mr5463747edd.349.1592504702666; Thu, 18 Jun 2020 11:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592504702; cv=none; d=google.com; s=arc-20160816; b=vdcWZiJqDAmgs1zL5Cfl5M5D1TsIs4hej+frBjavcJQhcpC5/PzyCt7V/U2Uf7/Utk 9WNIyIrI39yBfXkkPbiA+f0mevev4iNOhpEFOYjQrbOpTXtufntds/GQkKvBaVwfXBvS Nua6tJaqNCwg2JLUcjcD/MlfZSEJfoSDzi//b+5sVyMbMCRJxkR+ccRuBzhpljg/Zy+e WAHBVW5HoJx6ZbmbdbjQ01NnX5TjtiX+Rqs0ieDj1kjGLLKLTOfe8NiS4giDcauSzzP9 eGmLF3DndcNWrx0E+m7kbPSmWst3SfK9FzwZ8WBqlPiePa2fiYUqcmoIH3pvPnSB3q4s XQBw== 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=NtwtfirPIaj3hQKqt5NnTqLzfoXadlYH6xaXhH3mB+s=; b=wfH+cW6iYopanQbPhwsH/4/qNr17E+mc1/eqeg9wRjID9fNCDUivGtKwoaRFrm32+r p7CdDafYYJoeNMu+T5chOfY2+4tqT/xPeVG4UrgDAQBLD9MXFS1YL7BsHNEzGI53+u3h ll8liiPlRc3u/GnnTGs1gsuUlvNfKPtLaeXFDW4byW5MXepCBTXnDDCAmtTsTPYn4CKb h5fGum9rcItsFVqTt3SoEUE8JlEnG7fO+fJj6kjFpHe5nyOhExQFT8Imi184+21yP1Wz GKWU+Dp/ijl7zGpEzEFnwbsy6tOd89nFulK+Dz6m1xndjngGky/Lu2X+MczabgrRQRfV guCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kYwPKZdp; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd24si2385523edb.336.2020.06.18.11.24.28; Thu, 18 Jun 2020 11:25:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@gmail.com header.s=20161025 header.b=kYwPKZdp; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729204AbgFRPAJ (ORCPT + 99 others); Thu, 18 Jun 2020 11:00:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbgFRPAI (ORCPT ); Thu, 18 Jun 2020 11:00:08 -0400 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC3CFC06174E; Thu, 18 Jun 2020 08:00:07 -0700 (PDT) Received: by mail-io1-xd43.google.com with SMTP id m81so7406487ioa.1; Thu, 18 Jun 2020 08:00:07 -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=NtwtfirPIaj3hQKqt5NnTqLzfoXadlYH6xaXhH3mB+s=; b=kYwPKZdp0pHLg9nzSkXLUjXIWhhGSDK+lUsX3kvZKhpx/abFTtNYjkojW4sVVt7bHm qZGTxARuFd3WI6EfU1eBN6+4gj/yCc7G3VU2n21gea6aS3fkUz/uMmbZ6zjhs6dF/ctG mtQLDzrh6EKtHb9OSOEmMjo3N7fWi8hwmYyXXXcwlEWheXzJEY46FsRDyYJ/YXapbZEL GAjWeoKd6sh4vm2KkDp99cfVll6l6Xz1jcMVSif5RsT91SxuUdRKKCZShkXiMxJfDPO2 mEQ03gbiIGbBmN1vxaEfCsHPJle351uahP3BtuY+Amj/uplhgSOrlPpU1WHGNLMkS4iC lVIw== 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=NtwtfirPIaj3hQKqt5NnTqLzfoXadlYH6xaXhH3mB+s=; b=E9oYBpHSZYmC7FLuwZtM18HBTCZPtsRMxCzP0mIHBegoGebObr7eH9A7y4vuzcy66h Kd3F62IdMGfD/Q8vLsxuqYRk5AhEPIBg55HPyVBb0PGzoXl0igvA0SIPhQLYundiIMx+ tcgJqFJOaqh9yEL5uSqY55GT+USlIRYZVF/VfS9kNr13eJ53fAIBYIBO47RDw9NCtDJx yhJfYZTsJH7BAFHsYN1ySSDYNAWrsh5qRnguXjI7Nx5PypdyoEyfXovnVqwprgoFdeZx 0vHgfWRD82wxHZsrQ8boAvZ7JBHCLsK2Y/qXb1qZH4ZkXPcZs3sXiK4s9cDt8Jl3NJdC Apdw== X-Gm-Message-State: AOAM531PZUpGh13VrmFL1AJBCGva+2B1zX1VYE6NkKS9TH70KddBrTFW sDtIVOtYHe2ZjdVKqjAWQ1PnUYsWmMEG/bDDECQ= X-Received: by 2002:a05:6602:2dd4:: with SMTP id l20mr5412675iow.13.1592492407237; Thu, 18 Jun 2020 08:00:07 -0700 (PDT) MIME-Version: 1.0 References: <20200521095515.GK6462@dhcp22.suse.cz> <20200521163450.GV6462@dhcp22.suse.cz> <20200617135758.GA548179@chrisdown.name> <20200617141155.GQ9499@dhcp22.suse.cz> <20200617160624.GS9499@dhcp22.suse.cz> <20200617210935.GA578452@chrisdown.name> <20200618123743.GA694719@chrisdown.name> In-Reply-To: <20200618123743.GA694719@chrisdown.name> From: Yafang Shao Date: Thu, 18 Jun 2020 22:59:28 +0800 Message-ID: Subject: Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page To: Chris Down Cc: Naresh Kamboju , Michal Hocko , Anders Roxell , "Linux F2FS DEV, Mailing List" , linux-ext4 , linux-block , Andrew Morton , open list , Linux-Next Mailing List , linux-mm , Arnd Bergmann , Andreas Dilger , Jaegeuk Kim , "Theodore Ts'o" , Chao Yu , Hugh Dickins , Andrea Arcangeli , Matthew Wilcox , Chao Yu , lkft-triage@lists.linaro.org, Johannes Weiner , Roman Gushchin , Cgroups Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Jun 18, 2020 at 8:37 PM Chris Down wrote: > > Yafang Shao writes: > >On Thu, Jun 18, 2020 at 5:09 AM Chris Down wrote: > >> > >> Naresh Kamboju writes: > >> >After this patch applied the reported issue got fixed. > >> > >> Great! Thank you Naresh and Michal for helping to get to the bottom of this :-) > >> > >> I'll send out a new version tomorrow with the fixes applied and both of you > >> credited in the changelog for the detection and fix. > > > >As we have already found that the usage around memory.{emin, elow} has > >many limitations, I think memory.{emin, elow} should be used for > >memcg-tree internally only, that means they can only be used to > >calculate the protection of a memcg in a specified memcg-tree but > >should not be exposed to other MM parts. > > I agree that the current semantics are mentally taxing and we should generally > avoid exposing the implementation details outside of memcg where possible. Do > you have a suggested rework? :-) Keeping the mem_cgroup_protected() as-is is my suggestion. Anyway I think it is bad to put memory.{emin, elow} here and there. If we don't have any better idea by now, just putting all the references of memory.{emin, elow} into one wrapper(mem_cgroup_protected()) is the reasonable solution. -- Thanks Yafang