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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 10612C433DF for ; Wed, 17 Jun 2020 13:58:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3CAA20776 for ; Wed, 17 Jun 2020 13:58:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="oHJZsmwD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbgFQN6C (ORCPT ); Wed, 17 Jun 2020 09:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbgFQN6C (ORCPT ); Wed, 17 Jun 2020 09:58:02 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB2EC0613EF for ; Wed, 17 Jun 2020 06:58:01 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id l11so2481228wru.0 for ; Wed, 17 Jun 2020 06:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=czz/LMTUSEyCUOCBc2bpVTh7IggBB8ARvYVKv0fzm0w=; b=oHJZsmwDgazVpFYFy9f1b0DXnvsC0m5vxNXELt2qWUG2KfVfS0Fn9Az8Mm4tsT5Yun T0BN8K2g46PCiRW5Vtd3CYq9U6e5qZuldGsqUGrQVKibeXmeDBk6U6AB2EVkl4AOMQoQ bb1tNkHgfcvlaxd0Rj1tDcDG32lDe0/EQGnL4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=czz/LMTUSEyCUOCBc2bpVTh7IggBB8ARvYVKv0fzm0w=; b=CiPm6eJDbYirgseQuCwVRkbQYKESJmXhlbKPvnED3hycmxkojskdOt1JikLabQaeCe xmYKM71dDYQet/ABVHub0akHw6EFiI8DcBhRxGMWh2QGh4BU1Su9/f17fugbgg5DiwOQ BT4TuRmY5gF6meJKuHAveOGgdSogt+QCRICTyOcVFFAHFOBSpVVX59j++gSu1zoGUt9c qqRsvC5+GI9dBvkyuOiA2ucBKzQ6C+mFbmb6V5+9uFFwkp/qiIzZx/I6Eom8OfvPTWRT b94fbf6PTRN1AaR+FBM1OqgSQKD6yL6EaXrCxP1n4yNqZKqq2PAEdQLcXA1S+bTA/lTd TA/Q== X-Gm-Message-State: AOAM531Da+hsmpCWSnLmkz/vVaMHSXBoOub3LmpHdopiHt7UB5Ot2cN9 ysaqIUSvEYIL3iiJee9LNpEfvw== X-Google-Smtp-Source: ABdhPJxEWNxFxNxnJ3uLML+OdoNnGyXOqpBVbo7UMqTkjK8aBRi7UkKmaFuOunrzbNW+H9nqkV6M+Q== X-Received: by 2002:a5d:4286:: with SMTP id k6mr8336535wrq.140.1592402279710; Wed, 17 Jun 2020 06:57:59 -0700 (PDT) Received: from localhost ([2a01:4b00:8432:8a00:63de:dd93:20be:f460]) by smtp.gmail.com with ESMTPSA id 67sm35206526wrk.49.2020.06.17.06.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 06:57:58 -0700 (PDT) Date: Wed, 17 Jun 2020 14:57:58 +0100 From: Chris Down To: Naresh Kamboju Cc: Michal Hocko , Yafang Shao , 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 Subject: Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page Message-ID: <20200617135758.GA548179@chrisdown.name> References: <20200519075213.GF32497@dhcp22.suse.cz> <20200519084535.GG32497@dhcp22.suse.cz> <20200520190906.GA558281@chrisdown.name> <20200521095515.GK6462@dhcp22.suse.cz> <20200521163450.GV6462@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.3 (2020-06-14) Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org Naresh Kamboju writes: >mkfs -t ext4 /dev/disk/by-id/ata-TOSHIBA_MG04ACA100N_Y8RQK14KF6XF >mke2fs 1.43.8 (1-Jan-2018) >Creating filesystem with 244190646 4k blocks and 61054976 inodes >Filesystem UUID: 7c380766-0ed8-41ba-a0de-3c08e78f1891 >Superblock backups stored on blocks: >32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, >4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, >102400000, 214990848 >Allocating group tables: 0/7453 done >Writing inode tables: 0/7453 done >Creating journal (262144 blocks): [ 51.544525] under min:0 emin:0 >[ 51.845304] under min:0 emin:0 >[ 51.848738] under min:0 emin:0 >[ 51.858147] under min:0 emin:0 >[ 51.861333] under min:0 emin:0 >[ 51.862034] under min:0 emin:0 >[ 51.862442] under min:0 emin:0 >[ 51.862763] under min:0 emin:0 Thanks, this helps a lot. Somehow we're entering mem_cgroup_below_min even when min/emin is 0 (which should indeed be the case if you haven't set them in the hierarchy). My guess is that page_counter_read(&memcg->memory) is 0, which means mem_cgroup_below_min will return 1. However, I don't know for sure why that should then result in the OOM killer coming along. My guess is that since this memcg has 0 pages to scan anyway, we enter premature OOM under some conditions. I don't know why we wouldn't have hit that with the old version of mem_cgroup_protected that returned MEMCG_PROT_* members, though. Can you please try the patch with the `>=` checks in mem_cgroup_below_min and mem_cgroup_below_low changed to `>`? If that fixes it, then that gives a strong hint about what's going on here. Thanks for your help!