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 DB453C433E0 for ; Thu, 18 Jun 2020 15:00:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C7172073E for ; Thu, 18 Jun 2020 15:00:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kYwPKZdp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C7172073E 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 056258D002A; Thu, 18 Jun 2020 11:00:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F215D8D0018; Thu, 18 Jun 2020 11:00:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E10B58D002A; Thu, 18 Jun 2020 11:00:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id C593A8D0018 for ; Thu, 18 Jun 2020 11:00:21 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7E8F51527F9 for ; Thu, 18 Jun 2020 15:00:21 +0000 (UTC) X-FDA: 76942643442.03.basin63_5d1146326e11 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id ACCD428A24F for ; Thu, 18 Jun 2020 15:00:08 +0000 (UTC) X-HE-Tag: basin63_5d1146326e11 X-Filterd-Recvd-Size: 5300 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Jun 2020 15:00:07 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id q8so7379846iow.7 for ; 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=DAq5Obac4bL/Sr3H1ttGA9kwNATvyno17gK5GdErk1ujFUzvWygr+JAB/gbzKBA/zN U+Z6FA8ddFbUw0GIlvJIadG1VCKgy20eH77CbbXMjYKdz9NqCFAhyTqNDRTwD8Yp8pJM Uhni/RMVDCT0k+26WssPTEkEE5boIDSkUj3NP2kN1rHqaAz1Jgat/eyKdzfpTU66x+yE lVGvNqjNL0WmF/lA58asaPCP757ysF6LuSWF0eve5hQGwIdnghWiiVVYwICddd8p1omF H/9HYb3WIILNirM+fw66dPKTYLGfjML/ZOrhH1vzKSVXqR59cG0vFZ+EJxdFxjbDAkVz 3dig== X-Gm-Message-State: AOAM5315iJ6E+5oH1e0yHiLfV7YMkFyT0cP03Esy+AHxvDgRZVeP6Fjm 2ppvC1WMUYnA0nBqjS1lyPvDaOHbGloXgoB2cM8= X-Google-Smtp-Source: ABdhPJyxduBF4FPnbsePTb+IJMrnaO574t87lgH7MXGDrxKnm7Fm0uPL20a9JpNnhO5AEW9mefqTwucGCC8avIECgKo= 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" X-Rspamd-Queue-Id: ACCD428A24F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 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