Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp495407ybm; Thu, 28 May 2020 08:02:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt3AtlBO8CN2IFD7OtqAVG/flX0qTQshAqvSCG6Zk1t1bB3TSdjyWVl+GN/8054SzrJnoS X-Received: by 2002:aa7:d859:: with SMTP id f25mr3474273eds.292.1590678124572; Thu, 28 May 2020 08:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590678124; cv=none; d=google.com; s=arc-20160816; b=dMGmAH0Eg0LiyzMLuGt+sMZAj6q+SX0hl+m2TpZZ5hThMikun7vFv8tUz7NXNv2XLT +Gf0K6lCiXU3sxrzeAgIe4YJ2vMaJdJjVdDYC7yfuzlDaocPYJcIt3NgGoeEpWPVwXo+ b4kEW4F1KY8UElW29HfSZy9Rn1QPRXDmhgs27dO/kEmZj98p7Tw+JdZ2dbJLgM1bQZJE gY9zmszxmYJtLBEu01mhpVo4ASWZsbNTGlEuSWfgHI45Bp6SPv7qDEvH2ruv3S1oeNlF grnCMUPSIKfrMtWHKQqE1Jh1Chw9BOdw/ooG0DPRH//e1YJKVZ4jz25HVeJ2UDiFnj1j 2MKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=HvdKpHF042iTNApEGGudMnbcuPPZ+JOhqsO7H3d0iMc=; b=ufWhqe13iHOXl4G0EW3JJ73cOteMcfAzXKeETLjaJgigEkeocM35YAlf2009woShyW Hc983TvDczkahsfqNYaHJ4dlHo19AR7vdYoKxNvEqH/pUpoUHzZ5QDga6Pv8Ts3EKACM jmeKoJF2bLM+fw76QtxpSEPbu5gU/etfb8rarCRwYAxMOK/VEgqtbrt3au9XU8sZyYL3 E6dvQ57fTWxGdUrmhg7wtCKZALpvVYHVnJGskjnEKB54HOtL5ar4mMNEJU3mtroOx8+g urgBVTYIU2gBa8i3SqhkbBSqJT28ubl4JktIJOEsZcxNYopFeMXKHJB/hQ5DF7KZzbFY 4aMQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si3753484ejy.272.2020.05.28.08.01.35; Thu, 28 May 2020 08:02:04 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404007AbgE1O7y (ORCPT + 99 others); Thu, 28 May 2020 10:59:54 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54785 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403956AbgE1O7r (ORCPT ); Thu, 28 May 2020 10:59:47 -0400 Received: by mail-wm1-f66.google.com with SMTP id h4so3474221wmb.4; Thu, 28 May 2020 07:59:45 -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=sBhEmuSUd/GFOy3np6mV8rstzGSKw+c/3N7A5idKPh6bSBRzSjT8zi2hGTXx0IQ058 3vgOx1IIU/u5a1ArZyovHhM/CuTwqOBUcZURZfyXkNl4unIuv3y65nUSuXutlRnQHKhy hQXzBCA9ZY0vsz9gnD2qPuPnFcnIZKILRhMntigT8Wr+Rp6oytstrmuYreQsBqdfthN7 uy0pTvGAt+a61/QhVOjGQUG9KwdaVD6/6aZ0frMa0VjBvrskGW6Z04tq12L5JUIWUeYw tZTuwIwJu5uUcK3n0uw+DyJPgjqa2scQxwXvmGabrp8CHjr6+mPQsCCyZSWEzbD7DPcb QkwA== X-Gm-Message-State: AOAM5312Xv+4y5d8EKInL1tAq3ohf4MDrhdGv0td1MspagaaNnXDPlD1 JIVE+9LSrJlwkWcdjCpmmks= 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> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org [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