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=-4.0 required=3.0 tests=INCLUDES_PATCH, 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 2A415C433E0 for ; Thu, 21 May 2020 16:34:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BDC3020759 for ; Thu, 21 May 2020 16:34:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDC3020759 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 2F6E980008; Thu, 21 May 2020 12:34:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CC8E80007; Thu, 21 May 2020 12:34:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BBA280008; Thu, 21 May 2020 12:34:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id 05B7080007 for ; Thu, 21 May 2020 12:34:55 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B2F702C12 for ; Thu, 21 May 2020 16:34:54 +0000 (UTC) X-FDA: 76841275308.22.mist85_8223b26843d1e X-HE-Tag: mist85_8223b26843d1e X-Filterd-Recvd-Size: 6164 Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 May 2020 16:34:54 +0000 (UTC) Received: by mail-ej1-f67.google.com with SMTP id se13so9554980ejb.9 for ; Thu, 21 May 2020 09:34:54 -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=xPFD7IFPtAwroNkfi9MemR+cpIhDyy+Gat6jBDCzwmc=; b=fU+kZ5H3H/E4zdTCnpVb/n4lQzssNTZsgonca6DNO3B8tS4HHXYmvWk9wgnLxvTKgY B3Kais/8cJelwc+nJqCpR0B27QkU3sW+cATNTHP7r79AJkU9j0zx3TtgBfAu4d8t76vH +3FrwHtlU/5hnmMfimLW5RTc8RTV6x5g+P4cl9BKwaFFK3e5lYYGWiLG6Two5zbt5+0S HgpWy9zb82Ugd/gdrYdRlsYzObtF0wGoeQ94C51kIRJDCRMCoJw05p6tu01c4L2f1AEp vXC/CaFuhYZbCPuL4OFcpKNRCl8VZ1GdVk1/4e972VEA+PrRGNmMKC482UWjACCt43kU 5ySg== X-Gm-Message-State: AOAM532oyer1pMEHL4DrLvwo2HVez/w2w4k+U57cWrz9EmGR/MMBaYXO 6RzqXjT+SlRiopqy7HrTpwo= X-Google-Smtp-Source: ABdhPJwXVn3GpddymYyJuCnFqK41AXqqaHjxUQiP8VzaDxPtzIQQTqMUciYSPeaIDYFRbF092GX9fQ== X-Received: by 2002:a17:906:3607:: with SMTP id q7mr4218185ejb.81.1590078892997; Thu, 21 May 2020 09:34:52 -0700 (PDT) Received: from localhost (ip-37-188-180-112.eurotel.cz. [37.188.180.112]) by smtp.gmail.com with ESMTPSA id m27sm5175644eja.83.2020.05.21.09.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:34:51 -0700 (PDT) Date: Thu, 21 May 2020 18:34:50 +0200 From: Michal Hocko To: Naresh Kamboju , Chris Down 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@vger.kernel.org Subject: Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page Message-ID: <20200521163450.GV6462@dhcp22.suse.cz> References: <20200501135806.4eebf0b92f84ab60bba3e1e7@linux-foundation.org> <20200519075213.GF32497@dhcp22.suse.cz> <20200519084535.GG32497@dhcp22.suse.cz> <20200520190906.GA558281@chrisdown.name> <20200521095515.GK6462@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521095515.GK6462@dhcp22.suse.cz> 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 21-05-20 11:55:16, Michal Hocko wrote: > On Wed 20-05-20 20:09:06, Chris Down wrote: > > Hi Naresh, > > > > Naresh Kamboju writes: > > > As a part of investigation on this issue LKFT teammate Anders Roxell > > > git bisected the problem and found bad commit(s) which caused this problem. > > > > > > The following two patches have been reverted on next-20200519 and retested the > > > reproducible steps and confirmed the test case mkfs -t ext4 got PASS. > > > ( invoked oom-killer is gone now) > > > > > > Revert "mm, memcg: avoid stale protection values when cgroup is above > > > protection" > > > This reverts commit 23a53e1c02006120f89383270d46cbd040a70bc6. > > > > > > Revert "mm, memcg: decouple e{low,min} state mutations from protection > > > checks" > > > This reverts commit 7b88906ab7399b58bb088c28befe50bcce076d82. > > > > Thanks Anders and Naresh for tracking this down and reverting. > > > > I'll take a look tomorrow. I don't see anything immediately obviously wrong > > in either of those commits from a (very) cursory glance, but they should > > only be taking effect if protections are set. > > Agreed. If memory.{low,min} is not used then the patch should be > effectively a nop. I was staring into the code and do not see anything. Could you give the following debugging patch a try and see whether it triggers? diff --git a/mm/vmscan.c b/mm/vmscan.c index cc555903a332..df2e8df0eb71 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2404,6 +2404,8 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, * sc->priority further than desirable. */ scan = max(scan, SWAP_CLUSTER_MAX); + + trace_printk("scan:%lu protection:%lu\n", scan, protection); } else { scan = lruvec_size; } @@ -2648,6 +2650,7 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc) mem_cgroup_calculate_protection(target_memcg, memcg); if (mem_cgroup_below_min(memcg)) { + trace_printk("under min:%lu emin:%lu\n", memcg->memory.min, memcg->memory.emin); /* * Hard protection. * If there is no reclaimable memory, OOM. @@ -2660,6 +2663,7 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc) * there is an unprotected supply * of reclaimable memory from other cgroups. */ + trace_printk("under low:%lu elow:%lu\n", memcg->memory.low, memcg->memory.elow); if (!sc->memcg_low_reclaim) { sc->memcg_low_skipped = 1; continue; -- Michal Hocko SUSE Labs