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=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 D7907C433DF for ; Thu, 28 May 2020 14:59:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9F9782075F for ; Thu, 28 May 2020 14:59:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F9782075F 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 3702A8001A; Thu, 28 May 2020 10:59:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3214080010; Thu, 28 May 2020 10:59:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 237C98001A; Thu, 28 May 2020 10:59:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 0BDAA80010 for ; Thu, 28 May 2020 10:59:47 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BD517AD6F6 for ; Thu, 28 May 2020 14:59:46 +0000 (UTC) X-FDA: 76866437172.09.kick97_8f8616942ed3c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 8C88218034F69 for ; Thu, 28 May 2020 14:59:46 +0000 (UTC) X-HE-Tag: kick97_8f8616942ed3c X-Filterd-Recvd-Size: 6511 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 May 2020 14:59:46 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id u13so3491245wml.1 for ; Thu, 28 May 2020 07:59:46 -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=HvdKpHF042iTNApEGGudMnbcuPPZ+JOhqsO7H3d0iMc=; b=EFIC/p98pHumd8luSvgghfvsXBOff1lqOMsJg0ANuZFEWuCt/hoxVGOpVAJiKL3ojW wsRac7pjxgwK04yqY7nkRCnCj+ua5X42CDRfRzI5jEJS6GRhKpDkl1Ix8iGT3YXra8Y9 7Q+UiW4ZZR7oYRp3N2JuJE0w1gAB1zYOUfPsfzoP4jGDAyI3qpQVv8DMmv5B7JcDRDow tO3caqjpDp8cCMNFiyu22p/M0kL6he8tMLh7A0fYj2tq869ufrTEjh138PB2FhfwvrcJ TzV8td1RJD5HpoUmhMTW/a8BIZRMg0h/4AOvuYJxQcuISVIJQbct9rHWEVoBcL3rMhmr DhHA== X-Gm-Message-State: AOAM531VD2YSXqEg/f8Ng83Ss00p+TDS9HpphfZ8mTslJn83kaLcXuEC yks+Nc4QlXecZQMyVNMH5IM= X-Google-Smtp-Source: ABdhPJwLdJXj9IDbExOvEPWylXBWigVlYHMkRhO6O5dzYmOl704Ju6Ewl0cUi5F1r49EwVynvlA5Tw== X-Received: by 2002:a1c:230a:: with SMTP id j10mr3748329wmj.124.1590677985101; Thu, 28 May 2020 07:59:45 -0700 (PDT) Received: from localhost (ip-37-188-185-40.eurotel.cz. [37.188.185.40]) by smtp.gmail.com with ESMTPSA id t129sm2060873wmf.41.2020.05.28.07.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 07:59:44 -0700 (PDT) Date: Thu, 28 May 2020 16:59:42 +0200 From: Michal Hocko To: Johannes Weiner Cc: Hugh Dickins , Naresh Kamboju , Chris Down , 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 , Andrea Arcangeli , Matthew Wilcox , Chao Yu , lkft-triage@lists.linaro.org, Roman Gushchin , Cgroups Subject: Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page Message-ID: <20200528145942.GF27484@dhcp22.suse.cz> References: <20200520190906.GA558281@chrisdown.name> <20200521095515.GK6462@dhcp22.suse.cz> <20200521105801.GL6462@dhcp22.suse.cz> <20200521124444.GP6462@dhcp22.suse.cz> <20200521191746.GB815980@cmpxchg.org> <20200521215855.GB815153@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521215855.GB815153@cmpxchg.org> X-Rspamd-Queue-Id: 8C88218034F69 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: [Sorry for a late reply - was offline for few days] On Thu 21-05-20 17:58:55, Johannes Weiner wrote: > On Thu, May 21, 2020 at 01:06:28PM -0700, Hugh Dickins wrote: [...] > >From d9e7ed15d1c9248a3fd99e35e82437549154dac7 Mon Sep 17 00:00:00 2001 > From: Johannes Weiner > Date: Thu, 21 May 2020 17:44:25 -0400 > Subject: [PATCH] mm: memcontrol: prepare swap controller setup for integration > fix > > Fix crash with cgroup_disable=memory: > > > > > > + mkfs -t ext4 /dev/disk/by-id/ata-TOSHIBA_MG04ACA100N_Y8NRK0BPF6XF > > > > > mke2fs 1.43.8 (1-Jan-2018) > > > > > Creating filesystem with 244190646 4k blocks and 61054976 inodes > > > > > Filesystem UUID: 3bb1a285-2cb4-44b4-b6e8-62548f3ac620 > > > > > 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): [ 35.502102] BUG: kernel NULL > > > > > pointer dereference, address: 000000c8 > > > > > [ 35.508372] #PF: supervisor read access in kernel mode > > > > > [ 35.513506] #PF: error_code(0x0000) - not-present page > > > > > [ 35.518638] *pde = 00000000 > > > > > [ 35.521514] Oops: 0000 [#1] SMP > > > > > [ 35.524652] CPU: 0 PID: 145 Comm: kswapd0 Not tainted > > > > > 5.7.0-rc6-next-20200519+ #1 > > > > > [ 35.532121] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS > > > > > 2.2 05/23/2018 > > > > > [ 35.539507] EIP: mem_cgroup_get_nr_swap_pages+0x28/0x60 > > Swap accounting used to be implied-disabled when the cgroup controller > was disabled. Restore that for the new cgroup_memory_noswap, so that > we bail out of this function instead of dereferencing a NULL memcg. > > Reported-by: Naresh Kamboju > Debugged-by: Hugh Dickins > Debugged-by: Michal Hocko > Signed-off-by: Johannes Weiner Yes this looks better. I hope to get to your series soon to have the full picture finally. > --- > mm/memcontrol.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 3e000a316b59..e3b785d6e771 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -7075,7 +7075,11 @@ static struct cftype memsw_files[] = { > > static int __init mem_cgroup_swap_init(void) > { > - if (mem_cgroup_disabled() || cgroup_memory_noswap) > + /* No memory control -> no swap control */ > + if (mem_cgroup_disabled()) > + cgroup_memory_noswap = true; > + > + if (cgroup_memory_noswap) > return 0; > > WARN_ON(cgroup_add_dfl_cftypes(&memory_cgrp_subsys, swap_files)); > -- > 2.26.2 -- Michal Hocko SUSE Labs