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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 36C89C433E1 for ; Wed, 17 Jun 2020 14:12:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 04B2320734 for ; Wed, 17 Jun 2020 14:12:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04B2320734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 851036B0023; Wed, 17 Jun 2020 10:12:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8021B6B0024; Wed, 17 Jun 2020 10:12:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7405E6B0025; Wed, 17 Jun 2020 10:12:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0195.hostedemail.com [216.40.44.195]) by kanga.kvack.org (Postfix) with ESMTP id 5C2E36B0023 for ; Wed, 17 Jun 2020 10:12:03 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A1B22801AF14 for ; Wed, 17 Jun 2020 14:12:02 +0000 (UTC) X-FDA: 76938892884.04.mask99_0f0b4f226e08 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id B3CE580FD283 for ; Wed, 17 Jun 2020 14:11:59 +0000 (UTC) X-HE-Tag: mask99_0f0b4f226e08 X-Filterd-Recvd-Size: 5769 Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Wed, 17 Jun 2020 14:11:59 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id w7so2088665edt.1 for ; Wed, 17 Jun 2020 07:11:58 -0700 (PDT) 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; bh=FnLVx3mpNTRNn979KEIujDpuBEHdqJ/b/LKxqUKjo5U=; b=V4cwVoep/pd4riXcqTDrmGhYX37mONgfm/3N/nvjcJ+Vs+jbzIRyo6u3kaxwpkxkrf 9qZOq6jgTQmkVKyVS2PuIBJM52dYjB0wxgh50LLSvhKdcnVYA7HRjigShirSjONSY1mM EkNtI/qqIGAPHcgZcFCB64z/rxsrzHkILpHjBx5hNOEZU0pLN9UtU2kRkSVTaDx9nldF EqVHyrqcm5Zzj65H+rMhryTop6QpJnXZjXjFotftNIPTfIcl+d9p4mMTos27mueZxPZA c+EC6psxbVcIH2kyqQepSusnSgcYDzR2gdlW7jIdgO9orSsE7Bdahuho3EKdgp72O0S1 x/8g== X-Gm-Message-State: AOAM53393htXdhVCONczTlvHema5Y13wXLdKzKNwAm9M9fl+Ls1Mepxg VwOvmmeLnSOT/Ry3rt4UM8Q= X-Google-Smtp-Source: ABdhPJznS9MRNi7kFBPyQ0SPfnXV06mWSgLUfdEwyE6fs7gLQFQsvZDC9Kqw5DW5z+Zxjo6sXkZecQ== X-Received: by 2002:a05:6402:6cc:: with SMTP id n12mr7166151edy.266.1592403118087; Wed, 17 Jun 2020 07:11:58 -0700 (PDT) Received: from localhost (ip-37-188-158-19.eurotel.cz. [37.188.158.19]) by smtp.gmail.com with ESMTPSA id z20sm34596ejb.68.2020.06.17.07.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 07:11:57 -0700 (PDT) Date: Wed, 17 Jun 2020 16:11:55 +0200 From: Michal Hocko To: Chris Down Cc: Naresh Kamboju , 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: <20200617141155.GQ9499@dhcp22.suse.cz> 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> <20200617135758.GA548179@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200617135758.GA548179@chrisdown.name> X-Rspamd-Queue-Id: B3CE580FD283 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: [Our emails have crossed] On Wed 17-06-20 14:57:58, Chris Down wrote: > 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. Yes this is the case because this is likely the root memcg which skips all charges. > 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. Not really. There is likely no other memcg to reclaim from and assuming min limit protection will result in no reclaimable memory and thus the OOM killer. > 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. This would work but I believe an explicit check for the root memcg would be easier to spot the reasoning. -- Michal Hocko SUSE Labs