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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FA02C433EF for ; Wed, 22 Dec 2021 07:36:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C834D6B0072; Wed, 22 Dec 2021 02:36:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C33ED6B0073; Wed, 22 Dec 2021 02:36:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD4646B0074; Wed, 22 Dec 2021 02:36:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id 9F8BE6B0072 for ; Wed, 22 Dec 2021 02:36:44 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5F3AE8249980 for ; Wed, 22 Dec 2021 07:36:44 +0000 (UTC) X-FDA: 78944623128.23.F691BF7 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by imf31.hostedemail.com (Postfix) with ESMTP id 8EF1520038 for ; Wed, 22 Dec 2021 07:36:31 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id a23so1391451pgm.4 for ; Tue, 21 Dec 2021 23:36:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WrvvWhSLi37P9Hu9a/lN3dt16MiGegPkcEW+eWXvnco=; b=RKpi5mEKObOsMfFa2Hh3uM3GzsMIBcjoLEKD7cwnOeZVwpA/d0V88BawrYNtOMnFn7 l9nLVd1NKaLq5pB3voPPj4Z2icjvncDwuZ1uCcPIm6/WMKIxRRSgNH/mDo7gCP9SqWkU gYLMtOZHpZ2bc7XcFtJFnIgGuT/WDzmxB2cJqJdB0KPkqVUD86hast7AId9I1sCheseV FXPC48nv7polwBlytcx80Ge2CfcadbncgdXZ3ZbZeK1wttQ3MYdrMcX33gMLD2b77cBe 1XVNoWD64mGKqnHA2cr7yfFsOmBI796jO3rcUEeDFIAJ9d2aBQsqNJ50N2r74mkiVcl+ IdoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WrvvWhSLi37P9Hu9a/lN3dt16MiGegPkcEW+eWXvnco=; b=tPfv+w2euMl7D+LAFUDvr1wK84t/HIFpiSua9io5fWbrcxf34qQMBK/O7rt6l/AFt0 W4xsW9GzRGwQHjhDH9733t7iZPwNlo72++CvazcfsF3xnu2hqDhs0caK+hynfT0glXke 610OGYAWLSURHGJpppIONvk7tmlQmt3IrlvdOmViVMuJHYjFT9lZmAqznKqmpJP/OFTi DXUDo+GBRjsSPa4hJuZWqlmbI1K8htTbutQg54PHFRKWRj1eKu4YZ3oVtSE/Vr1Z/rc3 OZJrt6DG4foExM9OVVyuIIV+36Z6lVOWT3x3ai1vGC+bP/eKWj1Dr3n5gCSGKANhMs3u x/3Q== X-Gm-Message-State: AOAM5337J8aJkDE2HzrTieIgeDNhgYykPeS6h4ep1mY4lchVjoOs7S8d 9wTIClwW4/8m3gHN5OkYZ74= X-Google-Smtp-Source: ABdhPJyHgWJMD56kcLvcfd7Dna83oWWhHn+FdUZZGPKlzE0fgc8M5z+y33KIsE262NlfnBnCmss6iQ== X-Received: by 2002:a63:8f06:: with SMTP id n6mr1787692pgd.95.1640158602956; Tue, 21 Dec 2021 23:36:42 -0800 (PST) Received: from ip-172-31-30-232.ap-northeast-1.compute.internal (ec2-18-181-137-102.ap-northeast-1.compute.amazonaws.com. [18.181.137.102]) by smtp.gmail.com with ESMTPSA id v4sm884943pjk.38.2021.12.21.23.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 23:36:42 -0800 (PST) Date: Wed, 22 Dec 2021 07:36:33 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: Matthew Wilcox , Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg , linux-mm@kvack.org, Andrew Morton , patches@lists.linux.dev, Alexander Potapenko , Andrey Konovalov , Andrey Ryabinin , Andy Lutomirski , Borislav Petkov , cgroups@vger.kernel.org, Dave Hansen , David Woodhouse , Dmitry Vyukov , "H. Peter Anvin" , Ingo Molnar , iommu@lists.linux-foundation.org, Joerg Roedel , Johannes Weiner , Julia Lawall , kasan-dev@googlegroups.com, Lu Baolu , Luis Chamberlain , Marco Elver , Michal Hocko , Minchan Kim , Nitin Gupta , Peter Zijlstra , Sergey Senozhatsky , Suravee Suthikulpanit , Thomas Gleixner , Vladimir Davydov , Will Deacon , x86@kernel.org Subject: Re: [PATCH v2 00/33] Separate struct slab from struct page Message-ID: References: <20211201181510.18784-1-vbabka@suse.cz> <4c3dfdfa-2e19-a9a7-7945-3d75bc87ca05@suse.cz> <38976607-b9f9-1bce-9db9-60c23da65d2e@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <38976607-b9f9-1bce-9db9-60c23da65d2e@suse.cz> X-Rspamd-Queue-Id: 8EF1520038 X-Stat-Signature: q1zwcnmip8eii58uo64o5a8pa4mda5iw Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=RKpi5mEK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf31.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.215.177 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com X-Rspamd-Server: rspam11 X-HE-Tag: 1640158591-942657 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 Tue, Dec 21, 2021 at 12:58:14AM +0100, Vlastimil Babka wrote: > On 12/16/21 16:00, Hyeonggon Yoo wrote: > > On Tue, Dec 14, 2021 at 01:57:22PM +0100, Vlastimil Babka wrote: > >> On 12/1/21 19:14, Vlastimil Babka wrote: > >> > Folks from non-slab subsystems are Cc'd only to patches affecting them, and > >> > this cover letter. > >> > > >> > Series also available in git, based on 5.16-rc3: > >> > https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git/log/?h=slab-struct_slab-v2r2 > >> > >> Pushed a new branch slab-struct-slab-v3r3 with accumulated fixes and small tweaks > >> and a new patch from Hyeonggon Yoo on top. To avoid too much spam, here's a range diff: > > > > Reviewing the whole patch series takes longer than I thought. > > I'll try to review and test rest of patches when I have time. > > > > I added Tested-by if kernel builds okay and kselftests > > does not break the kernel on my machine. > > (with CONFIG_SLAB/SLUB/SLOB depending on the patch), > > Thanks! > :) > > Let me know me if you know better way to test a patch. > > Testing on your machine is just fine. > Good! > > # mm/slub: Define struct slab fields for CONFIG_SLUB_CPU_PARTIAL only when enabled > > > > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > > > Comment: > > Works on both SLUB_CPU_PARTIAL and !SLUB_CPU_PARTIAL. > > btw, do we need slabs_cpu_partial attribute when we don't use > > cpu partials? (!SLUB_CPU_PARTIAL) > > The sysfs attribute? Yeah we should be consistent to userspace expecting to > read it (even with zeroes), regardless of config. > I thought entirely disabling the attribute is simpler, But okay If it should be exposed even if it's always zero. > > # mm/slub: Simplify struct slab slabs field definition > > Comment: > > > > This is how struct page looks on the top of v3r3 branch: > > struct page { > > [...] > > struct { /* slab, slob and slub */ > > union { > > struct list_head slab_list; > > struct { /* Partial pages */ > > struct page *next; > > #ifdef CONFIG_64BIT > > int pages; /* Nr of pages left */ > > #else > > short int pages; > > #endif > > }; > > }; > > [...] > > > > It's not consistent with struct slab. > > Hm right. But as we don't actually use the struct page version anymore, and > it's not one of the fields checked by SLAB_MATCH(), we can ignore this. > Yeah this is not a big problem. just mentioned this because it looked weird and I didn't know when the patch "mm: Remove slab from struct page" will come back. > > I think this is because "mm: Remove slab from struct page" was dropped. > > That was just postponed until iommu changes are in. Matthew mentioned those > might be merged too, so that final cleanup will happen too and take care of > the discrepancy above, so no need for extra churn to address it speficially. > Okay it seems no extra work needed until the iommu changes are in! BTW, in the patch (that I sent) ("mm/slob: Remove unnecessary page_mapcount_reset() function call"), it refers commit 4525180926f9 ("mm/sl*b: Differentiate struct slab fields by sl*b implementations"). But the commit hash 4525180926f9 changed after the tree has been changed. It will be nice to write a script to handle situations like this. > > Would you update some of patches? > > > > # mm/sl*b: Differentiate struct slab fields by sl*b implementations > > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > Works SL[AUO]B on my machine and makes code much better. > > > > # mm/slob: Convert SLOB to use struct slab and struct folio > > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > It still works fine on SLOB. > > > > # mm/slab: Convert kmem_getpages() and kmem_freepages() to struct slab > > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > > > # mm/slub: Convert __free_slab() to use struct slab > > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > > > Thanks, > > Hyeonggon. > > Thanks again, > Vlastimil Have a nice day, thanks! Hyeonggon.