Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp593264ybt; Wed, 17 Jun 2020 08:56:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoOokTA0UGgvsEgEuF/EI6B9EePwYTIqi1f922mJEbxoeRgzHEy3Bq4KbRCJ+TzoEYXaOP X-Received: by 2002:aa7:d359:: with SMTP id m25mr7614590edr.365.1592409401588; Wed, 17 Jun 2020 08:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592409401; cv=none; d=google.com; s=arc-20160816; b=ktkgd2vMpAU+ESNMlwsqZP2PKQQt7gLXO1mgEx1uzB8JM0k0nIf3eis+erZ9MuBuWz PFErjGK7Sexm74l4nVw/dBxclIT7/5LGkoHLwaUwzSVHw0XPZlllC1uWSfFal0a/dFJX MQMSyQAmkexhAEN5vahkLjnKJCSZAX3JFFKkOB3QnN/L/mAMl6Vn6ZBdmi9pIwQMNCGV x/Xul7/MKeubQIwXy/veWeNqCUmmiGpbfNYRDusFf9RWcKi3xgY508hBNZ5hDGt9pBOC vB9wqZIEkJ7Yyq06e2Gt7cGx6HJkQpLBedLLuuLoaqbyXUPrmzI5A9ekkPpaxWQ/W5u9 IVXw== 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=Iil/oRjunCxRdn4O9EnhL5vFoe9sKPuHAAfETKSmZUw=; b=KO9RoMMurt9y4yUHvfqzbMOAZHfx4Z049nsaqcnU9uuxuyBE2/i/ZTZXuKa8gRTBht dQ4sV+EmvbJFW/argiCnclTUt3bXmaqAUnbIHfMIpk+hOGebRBPq1UGop0xDSg7QZK8K ei6j1d51+NT2A9HPqvXERbqJF1AS04pahAvRJkKPu+hot7UtwTMZnbrG0HH/BdhJKUh5 02cfCuFuCzYeSleWUISXDqD5XIJKhNfZcKEzF8+MFxFddoNUn1O9weteRY5Ao/PAq2Mm AK80LXx1NGRoTC9adTu8QcW99mC/qd5pqJxDyTYdN0SAC5hn3kUBSFNsb6cknrs75YWG mFVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zhIwFYvq; 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=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 qu2si167998ejb.89.2020.06.17.08.56.08; Wed, 17 Jun 2020 08:56:41 -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=@linaro.org header.s=google header.b=zhIwFYvq; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbgFQPxV (ORCPT + 99 others); Wed, 17 Jun 2020 11:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbgFQPxU (ORCPT ); Wed, 17 Jun 2020 11:53:20 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 347F5C061755 for ; Wed, 17 Jun 2020 08:53:19 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id 9so3475629ljc.8 for ; Wed, 17 Jun 2020 08:53:19 -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=Iil/oRjunCxRdn4O9EnhL5vFoe9sKPuHAAfETKSmZUw=; b=zhIwFYvqS5d/Wg1MMLhDRV3GH6WnWZlkpKF5Gvf2n+o3mBbraSv6/+gF1/wVQ7Kcyp adAODQsWOEjXxtmaTAY8OOgeomh977J+Ip2X4RUs+QJLXP8fCHiBMryYWwGWY4gfVz+j OiEw3dpJmeQ9Ih8zjHeprM4Gt9tFC88PRlY3V32JvNQHp+cM065+LxGIkdQfR1HdKSbO xKOJtEAbSIP0jDNqHyXlIFM3pvnyIAdrXeT9Vjt+d3kXsBP5VgSVyDytRxe/UXnnLsyA sJ7nJiD9AsZ7Gc1Ka2IK/tLWXp9TnAK5clcp93WHPbbonXUq5u2axMTwgQjbamGfwQSH D6KA== 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=Iil/oRjunCxRdn4O9EnhL5vFoe9sKPuHAAfETKSmZUw=; b=CJLd+zjJIBgeU6Gi0LpU3LYwxupIFoBZtd9+s3HfCzZpRKyfbausvC2UySAl5u5lB0 Jlgs1CNRAZlgzAI4dxRsYuc8w+TWJltbfZkDN0S+x6Fo9MoPfAGKmJRjTejXiScrfBks kTEffy4IKWcARDmk/p+DAwCdRStnzvGgHN6FBPQ3buQrVOjF2yvapdGLTOmPMvTYGnqj Oq25j94B6qMJgIiJKbZOKTF+zIujDFlLkz1lnBsBxxQLZRj9MvE6xfI6CIdTM7g1ItyO j6ZK6gBtNDntsKVQwSlCY68YFxG9R8Zj1s70TbQxo+aRnWKNFdGELjLlquvRG2dlbCNd CqAA== X-Gm-Message-State: AOAM532GJizl49I7+mPyK4nWtTWk/dqNAyN6pud5DTgU62w5gauY0tw8 VBKbOne9Hng788Uw+/DagxrI004rQyTuj8I5ZIxnmw== X-Received: by 2002:a2e:911:: with SMTP id 17mr4655723ljj.411.1592409197458; Wed, 17 Jun 2020 08:53:17 -0700 (PDT) MIME-Version: 1.0 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> <20200617141155.GQ9499@dhcp22.suse.cz> In-Reply-To: <20200617141155.GQ9499@dhcp22.suse.cz> From: Naresh Kamboju Date: Wed, 17 Jun 2020 21:23:05 +0530 Message-ID: Subject: Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page To: Chris Down , Michal Hocko Cc: 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 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 Wed, 17 Jun 2020 at 19:41, Michal Hocko wrote: > > [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. May I request you to send debugging or proposed fix patches here. I am happy to do more testing. FYI, Here is my repository for testing. git: https://github.com/nareshkamboju/linux/tree/printk branch: printk - Naresh