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 58971C433E0 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 364F3216FD for ; Wed, 17 Jun 2020 13:58:03 +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 S1726494AbgFQN6C (ORCPT ); Wed, 17 Jun 2020 09:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgFQN6C (ORCPT ); Wed, 17 Jun 2020 09:58:02 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92931C0613ED for ; Wed, 17 Jun 2020 06:58:01 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id x6so2418984wrm.13 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=aIHaPEZVqdjAdqNMJPdenhvzv3WJQCLpCqiRzDW3d8kjtBnc0gD0HU4QnbNJzzc3w3 FNuQp6Fb9Z3fcXT3NncOUSj3oNYzRHV0LGy8bKAWA5IAedsHOP2UzGQYs115sUq7fHNJ ETMU0fY4eYO4g0Gm57i8kjF3I/qjqlg8n10czvSOrgo2ZQepfklA8IBSurF/2jLx+B1T FM3VOGo68wX9PCTWSmxsJz4WhDQ2y9qLw2vH1/IOWTiITgWOanrwstx27QqXpBu1i71T z3ZaS3p4RkT3WcyCp5/UGf9skfwSiSWF1YNKtEjHGVH7iuPV2Qr1qMu2TmYibQmRgQyH iJBQ== X-Gm-Message-State: AOAM533mwPuoKKjyDNF3FoAWwIB73zcJEVgan6qYS+/hSmnRxI/ZMc2p HbvpDSz0gKAJxSPU51hLg4IOLA== 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-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@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! 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 6EF71C433E1 for ; Wed, 17 Jun 2020 13:58:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 31B6020776 for ; Wed, 17 Jun 2020 13:58:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="oHJZsmwD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31B6020776 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9B5996B0003; Wed, 17 Jun 2020 09:58:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 967746B000D; Wed, 17 Jun 2020 09:58:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 855C56B0022; Wed, 17 Jun 2020 09:58:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 6C5076B0003 for ; Wed, 17 Jun 2020 09:58:02 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 07724B16B for ; Wed, 17 Jun 2020 13:58:02 +0000 (UTC) X-FDA: 76938857604.13.dust49_11105ca26e08 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id D383F18140D63 for ; Wed, 17 Jun 2020 13:58:01 +0000 (UTC) X-HE-Tag: dust49_11105ca26e08 X-Filterd-Recvd-Size: 5856 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Wed, 17 Jun 2020 13:58:01 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id t18so2449598wru.6 for ; Wed, 17 Jun 2020 06:58:00 -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=VOd3Rw9d+Xq1qKIHNQqur4ArGe3yp2lK85E6Tm+YD8KggagNS0v9gI1vUjZPNckvzU lrlFnKy6HA03TYal8u3W7R3toXhgfMLXiJybB5xS2QNazMheMRtA8WRmLZooYnSe5RlH mEsVEAuiPLrLvE5L2w3WolrKE02YcaB20yp119pb+sS6nZ+wUdTzTw4+xrVc1sHEIjPu 5a7HbvHySzEd3lGIyNL37LvOK/GU5QQIT6RGVpq/K/WvmycJJr8oBG+r9wGF6yqtxTcQ aNPng3PAJ+HhwZbGXIgFlKkNVO56X8rj9ukNWmVd1twB1DK8oravQN4sGRY+4QvTfnm9 OEdg== X-Gm-Message-State: AOAM533iKAgjnBBXmREFQU+F7LSPNn8HFvUBkLEdohj3GCgedqU/gjXB UfSByl7HhKAAqmeHD225rQXgow== 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) X-Rspamd-Queue-Id: D383F18140D63 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: 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! 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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 10451C433E0 for ; Wed, 17 Jun 2020 14:04:49 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D56A220734 for ; Wed, 17 Jun 2020 14:04:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="Mw6RH0Mz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="TYUF6jAR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="oHJZsmwD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D56A220734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jlYgK-0004oz-DK; Wed, 17 Jun 2020 14:04:48 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlYgJ-0004ot-JL for linux-f2fs-devel@lists.sourceforge.net; Wed, 17 Jun 2020 14:04:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=czz/LMTUSEyCUOCBc2bpVTh7IggBB8ARvYVKv0fzm0w=; b=Mw6RH0Mz/J/gd9diBbhjMBxaE1 Q3cf8QgcKmKv8QttGo6k1A8eFMbHiJqs7fVoPTpBzfnBmKuzRYZVvfH2Um/62HK3xT8D++Vb3A1w2 G1C9pRFyyxCoTcTq8kBZ39+G2K8Wu0o74VbfBx4RL9ZAiCZYc5MB5etdea7iFVayohMM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=czz/LMTUSEyCUOCBc2bpVTh7IggBB8ARvYVKv0fzm0w=; b=TYUF6jARiXYVtgytbuuntE3/fw yim+HB4EDfiPCvMOR/PceB5+hkqrK2CIje++lYtsIz/PA622l62/wwKldOO4CBVAViaF1cFqLL4Gy DVvJvPRTBaTqRFxxDKAVWUdXgk2WalplDAnMJuhN57u6ueXlY6rWDcq5mUg29VaCTiMo=; Received: from mail-ed1-f68.google.com ([209.85.208.68]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1jlYgC-009RJ3-47 for linux-f2fs-devel@lists.sourceforge.net; Wed, 17 Jun 2020 14:04:47 +0000 Received: by mail-ed1-f68.google.com with SMTP id c35so2036406edf.5 for ; Wed, 17 Jun 2020 07:04:40 -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=mMkmIgYa2dMGvuG2BN7BGOMbGidQ8voIQZdFgiK2PaENyyHcsKr9y059d+yYd0pUuA dfet4s237f/btMaY/Wnl6/ypHzTdHAm5wqxmuWhNLPye3dXMfgdK5w6EHVbfJ8n1FJb6 PslnsdWWxx9txMYZFr+1l0tdZ6CvqLRFRHVa4Agu1piX6LIDtRz3NEPms8RR49qfYnvx xKHbNoIqs9gs4/ntrEKDBPfNDzR1FJRb57xRreXyWvXfOgMFMe/5ztE/vB1Vng5eXvrB TMpca97cJ+CkS1kA6DaRIAoAsCVU7ajfaaF86YpdLAwGbM4ls2fUrbR73OjJd3pg9e77 Ch8Q== X-Gm-Message-State: AOAM530cJaDfUAnzO0V5QKFlGUaaF4R5Jit7LZrliLmbsCCQ2kIjbp1w YdH6qJ/pQkWj0Py4UMeoKNM/h9TlA7VDpADA 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.3 (2020-06-14) X-Headers-End: 1jlYgC-009RJ3-47 Subject: Re: [f2fs-dev] mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lkft-triage@lists.linaro.org, Michal Hocko , linux-mm , Yafang Shao , Andreas Dilger , Cgroups , Andrea Arcangeli , Anders Roxell , Hugh Dickins , Matthew Wilcox , Linux-Next Mailing List , linux-ext4 , Arnd Bergmann , linux-block , Jaegeuk Kim , Theodore Ts'o , open list , "Linux F2FS DEV, Mailing List" , Johannes Weiner , Andrew Morton , Roman Gushchin Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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! _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Down Subject: Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page Date: Wed, 17 Jun 2020 14:57:58 +0100 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 Return-path: 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= Content-Disposition: inline In-Reply-To: Sender: linux-block-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit 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@l 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!