From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 296AA2C80 for ; Wed, 29 Dec 2021 11:23:04 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id w24so15660900ply.12 for ; Wed, 29 Dec 2021 03:23:04 -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=B8D9h3oa8OpyqxIH3xe2rIOLYO1p/ntyh/ItEZc2ers=; b=WGgAxIa78MQr67iJtQ1TD1NaSUDzL8Sj14e4SvxYWhEN9di3WJIBnUF+L3ExcGr1oj QG61NAIFhjT/XTvY0CDIKSy0x2wdhjgp5o3CP/sn9tLZp0iIoIh8BXvPhaMFXpuLfzRl ssYONzQtGOvuMs4NA/1vndNqMZ2aeOxJ5COnpBFYJWM3L7v9L5GRfb6CzWNnmn7NDNB5 Y3k9y/k0SaoD8ZsB9lFCcDRjDybncaD5TD9GRZZ/dYi8Nrw8/TG12zPX6PJi/KX88OD2 OuID2/9IQHJyO+voFSIrf5Pg524R1rvzzNEz20N8dgdaI7Q3jfQjIb0uJgqdnoHZZxJI MBfA== 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=B8D9h3oa8OpyqxIH3xe2rIOLYO1p/ntyh/ItEZc2ers=; b=TvLrbVtIXHXh+Ry1xenBcw+R91tZw0OaFlSdKKx3DiDA2X/1pxtSYFPqWz54R7YPYL DUlR6wcvnWShfyVmCxqiHSxnoY8sIm8h7LiqDaLGNBDFLtVA5CfCXJZRhLgaZSi4AOiG bUm+ltV5xm2UlYXKIfhSRxoq+qo6X7E5Uobxf/xXaHpX5HSI+WAl6mW4OG2+0fhmU9X2 VTu71AA4htGcsmWiWsFm77FoX3NCd/INIKdVos++1nAMt6pupMDTRJ1NSDYQ0kRePYJP vn5TnIrKegCkSom6N2DDEkgEauZt0GgbOVyUGSx16WOViQwdcdphA6mH0gg2R5sj0rTM rK4A== X-Gm-Message-State: AOAM5332g1gcjJqHRRAWmHRB87Af7UWOktbdK9gvJBVBvhPEaY72BBaI aEx7Ik/yHlUQdihC3dDucOo= X-Google-Smtp-Source: ABdhPJwuzAxU4R0IYSsKh74KLKKx3PviuJjkKN5hUYyTQsDBZbYnOyqmi34FrA9NClJ4Q9W7ZJbPJg== X-Received: by 2002:a17:902:9343:b0:148:a2e7:fb5f with SMTP id g3-20020a170902934300b00148a2e7fb5fmr27487300plp.160.1640776983676; Wed, 29 Dec 2021 03:23:03 -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 pf7sm27063114pjb.8.2021.12.29.03.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 03:23:03 -0800 (PST) Date: Wed, 29 Dec 2021 11:22:54 +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, Roman Gushchin 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> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Dec 22, 2021 at 05:56:50PM +0100, Vlastimil Babka wrote: > On 12/14/21 13:57, 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: > > Hi, I've pushed another update branch slab-struct_slab-v4r1, and also to > -next. I've shortened git commit log lines to make checkpatch happier, > so no range-diff as it would be too long. I believe it would be useless > spam to post the whole series now, shortly before xmas, so I will do it > at rc8 time, to hopefully collect remaining reviews. But if anyone wants > a mailed version, I can do that. > Hello Matthew and Vlastimil. it's part 3 of review. # mm: Convert struct page to struct slab in functions used by other subsystems Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> # mm/slub: Convert most struct page to struct slab by spatch Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> with a question below. -static int check_slab(struct kmem_cache *s, struct page *page) +static int check_slab(struct kmem_cache *s, struct slab *slab) { int maxobj; - if (!PageSlab(page)) { - slab_err(s, page, "Not a valid slab page"); + if (!folio_test_slab(slab_folio(slab))) { + slab_err(s, slab, "Not a valid slab page"); return 0; } Can't we guarantee that struct slab * always points to a slab? for struct page * it can be !PageSlab(page) because struct page * can be other than slab. but struct slab * can only be slab unlike struct page. code will be simpler if we guarantee that struct slab * always points to a slab (or NULL). # mm/slub: Convert pfmemalloc_match() to take a struct slab It's confusing to me because the original pfmemalloc_match() is removed and pfmemalloc_match_unsafe() was renamed to pfmemalloc_match() and converted to use slab_test_pfmemalloc() helper. But I agree with the resulting code. so: Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> # mm/slub: Convert alloc_slab_page() to return a struct slab Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> # mm/slub: Convert print_page_info() to print_slab_info() Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> I hope to review rest of patches in a week. Thanks, Hyeonggon > Changes in v4: > - rebase to 5.16-rc6 to avoid a conflict with mainline > - collect acks/reviews/tested-by from Johannes, Roman, Hyeonggon Yoo - > thanks! > - in patch "mm/slub: Convert detached_freelist to use a struct slab" > renamed free_nonslab_page() to free_large_kmalloc() and use folio there, > as suggested by Roman > - in "mm/memcg: Convert slab objcgs from struct page to struct slab" > change one caller of slab_objcgs_check() to slab_objcgs() as suggested > by Johannes, realize the other caller should be also changed, and remove > slab_objcgs_check() completely. 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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EEAEBC433F5 for ; Wed, 29 Dec 2021 11:23:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8BF4260BB1; Wed, 29 Dec 2021 11:23:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SQohR_A3ZLOy; Wed, 29 Dec 2021 11:23:07 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4897860709; Wed, 29 Dec 2021 11:23:07 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 18FF1C002F; Wed, 29 Dec 2021 11:23:07 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 365A1C0012 for ; Wed, 29 Dec 2021 11:23:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1DE8260A46 for ; Wed, 29 Dec 2021 11:23:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q9XNv9KRk5Yr for ; Wed, 29 Dec 2021 11:23:04 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4FA2560709 for ; Wed, 29 Dec 2021 11:23:04 +0000 (UTC) Received: by mail-pj1-x102b.google.com with SMTP id rj2-20020a17090b3e8200b001b1944bad25so19633085pjb.5 for ; Wed, 29 Dec 2021 03:23:04 -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=B8D9h3oa8OpyqxIH3xe2rIOLYO1p/ntyh/ItEZc2ers=; b=WGgAxIa78MQr67iJtQ1TD1NaSUDzL8Sj14e4SvxYWhEN9di3WJIBnUF+L3ExcGr1oj QG61NAIFhjT/XTvY0CDIKSy0x2wdhjgp5o3CP/sn9tLZp0iIoIh8BXvPhaMFXpuLfzRl ssYONzQtGOvuMs4NA/1vndNqMZ2aeOxJ5COnpBFYJWM3L7v9L5GRfb6CzWNnmn7NDNB5 Y3k9y/k0SaoD8ZsB9lFCcDRjDybncaD5TD9GRZZ/dYi8Nrw8/TG12zPX6PJi/KX88OD2 OuID2/9IQHJyO+voFSIrf5Pg524R1rvzzNEz20N8dgdaI7Q3jfQjIb0uJgqdnoHZZxJI MBfA== 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=B8D9h3oa8OpyqxIH3xe2rIOLYO1p/ntyh/ItEZc2ers=; b=zM3KjS1wEgxR5PJUlDiMgSpEBX4vSUThI04FQJg/vCuUfFyJ8EP42c9UwO1ALHPHig oLSbOaa75nscSLCu6acoHuq3B1W6Wta4SQMbP4Wt7zlJhrGaJMqolhvnNuu6S5OAOSkQ q8edJnzgYvsauJPHKFUqCuF+jkCQzO6ocot7/XF8jypDm6KASLMWk5Tsxa7DJXxrdPlo xC58Jt0NAiMemaANxu0yFD4FPAYsS8Kxdj2qAiLQo1X0hn/o2wkpLzJbqCFjz50UCEz0 5fdg6cDTvxO3Ci1pNb/X7eSlYQ5IRpdmHuXl+i1xR8HUFqTlcqvMTlsKHwd1OGJ/ZLtg oSWQ== X-Gm-Message-State: AOAM533Xb9rOWn5Bq2M0sSqX8aY1zwfb+65olPXVUQD41y7JPEC7zfxQ 5A5jw4xCDgO02NlL9/fRbGg= X-Google-Smtp-Source: ABdhPJwuzAxU4R0IYSsKh74KLKKx3PviuJjkKN5hUYyTQsDBZbYnOyqmi34FrA9NClJ4Q9W7ZJbPJg== X-Received: by 2002:a17:902:9343:b0:148:a2e7:fb5f with SMTP id g3-20020a170902934300b00148a2e7fb5fmr27487300plp.160.1640776983676; Wed, 29 Dec 2021 03:23:03 -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 pf7sm27063114pjb.8.2021.12.29.03.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 03:23:03 -0800 (PST) Date: Wed, 29 Dec 2021 11:22:54 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: Peter Zijlstra , Dave Hansen , Michal Hocko , linux-mm@kvack.org, Andrey Ryabinin , Alexander Potapenko , kasan-dev@googlegroups.com, "H. Peter Anvin" , Christoph Lameter , Will Deacon , Julia Lawall , Sergey Senozhatsky , x86@kernel.org, Luis Chamberlain , Matthew Wilcox , Ingo Molnar , Vladimir Davydov , David Rientjes , Nitin Gupta , Marco Elver , Borislav Petkov , Andy Lutomirski , cgroups@vger.kernel.org, Thomas Gleixner , Joonsoo Kim , Dmitry Vyukov , Andrey Konovalov , patches@lists.linux.dev, Pekka Enberg , Minchan Kim , iommu@lists.linux-foundation.org, Johannes Weiner , Andrew Morton , David Woodhouse , Roman Gushchin X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Dec 22, 2021 at 05:56:50PM +0100, Vlastimil Babka wrote: > On 12/14/21 13:57, 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: > > Hi, I've pushed another update branch slab-struct_slab-v4r1, and also to > -next. I've shortened git commit log lines to make checkpatch happier, > so no range-diff as it would be too long. I believe it would be useless > spam to post the whole series now, shortly before xmas, so I will do it > at rc8 time, to hopefully collect remaining reviews. But if anyone wants > a mailed version, I can do that. > Hello Matthew and Vlastimil. it's part 3 of review. # mm: Convert struct page to struct slab in functions used by other subsystems Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> # mm/slub: Convert most struct page to struct slab by spatch Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> with a question below. -static int check_slab(struct kmem_cache *s, struct page *page) +static int check_slab(struct kmem_cache *s, struct slab *slab) { int maxobj; - if (!PageSlab(page)) { - slab_err(s, page, "Not a valid slab page"); + if (!folio_test_slab(slab_folio(slab))) { + slab_err(s, slab, "Not a valid slab page"); return 0; } Can't we guarantee that struct slab * always points to a slab? for struct page * it can be !PageSlab(page) because struct page * can be other than slab. but struct slab * can only be slab unlike struct page. code will be simpler if we guarantee that struct slab * always points to a slab (or NULL). # mm/slub: Convert pfmemalloc_match() to take a struct slab It's confusing to me because the original pfmemalloc_match() is removed and pfmemalloc_match_unsafe() was renamed to pfmemalloc_match() and converted to use slab_test_pfmemalloc() helper. But I agree with the resulting code. so: Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> # mm/slub: Convert alloc_slab_page() to return a struct slab Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> # mm/slub: Convert print_page_info() to print_slab_info() Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> I hope to review rest of patches in a week. Thanks, Hyeonggon > Changes in v4: > - rebase to 5.16-rc6 to avoid a conflict with mainline > - collect acks/reviews/tested-by from Johannes, Roman, Hyeonggon Yoo - > thanks! > - in patch "mm/slub: Convert detached_freelist to use a struct slab" > renamed free_nonslab_page() to free_large_kmalloc() and use folio there, > as suggested by Roman > - in "mm/memcg: Convert slab objcgs from struct page to struct slab" > change one caller of slab_objcgs_check() to slab_objcgs() as suggested > by Johannes, realize the other caller should be also changed, and remove > slab_objcgs_check() completely. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Subject: Re: [PATCH v2 00/33] Separate struct slab from struct page Date: Wed, 29 Dec 2021 11:22:54 +0000 Message-ID: References: <20211201181510.18784-1-vbabka@suse.cz> <4c3dfdfa-2e19-a9a7-7945-3d75bc87ca05@suse.cz> Mime-Version: 1.0 Return-path: 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=B8D9h3oa8OpyqxIH3xe2rIOLYO1p/ntyh/ItEZc2ers=; b=WGgAxIa78MQr67iJtQ1TD1NaSUDzL8Sj14e4SvxYWhEN9di3WJIBnUF+L3ExcGr1oj QG61NAIFhjT/XTvY0CDIKSy0x2wdhjgp5o3CP/sn9tLZp0iIoIh8BXvPhaMFXpuLfzRl ssYONzQtGOvuMs4NA/1vndNqMZ2aeOxJ5COnpBFYJWM3L7v9L5GRfb6CzWNnmn7NDNB5 Y3k9y/k0SaoD8ZsB9lFCcDRjDybncaD5TD9GRZZ/dYi8Nrw8/TG12zPX6PJi/KX88OD2 OuID2/9IQHJyO+voFSIrf5Pg524R1rvzzNEz20N8dgdaI7Q3jfQjIb0uJgqdnoHZZxJI MBfA== Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Vlastimil Babka Cc: Matthew Wilcox , Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Andrew Morton , patches-cunTk1MwBs/YUNznpcFYbw@public.gmane.org, Alexander Potapenko , Andrey Konovalov , Andrey Ryabinin , Andy Lutomirski , Borislav Petkov , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dave Hansen , David Woodhouse , Dmitry Vyukov , "H. Peter Anvin" , Ingo Molnar , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Joerg Roedel , Johannes Weiner On Wed, Dec 22, 2021 at 05:56:50PM +0100, Vlastimil Babka wrote: > On 12/14/21 13:57, 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: > > Hi, I've pushed another update branch slab-struct_slab-v4r1, and also to > -next. I've shortened git commit log lines to make checkpatch happier, > so no range-diff as it would be too long. I believe it would be useless > spam to post the whole series now, shortly before xmas, so I will do it > at rc8 time, to hopefully collect remaining reviews. But if anyone wants > a mailed version, I can do that. > Hello Matthew and Vlastimil. it's part 3 of review. # mm: Convert struct page to struct slab in functions used by other subsystems Reviewed-by: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> # mm/slub: Convert most struct page to struct slab by spatch Reviewed-by: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Tested-by: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> with a question below. -static int check_slab(struct kmem_cache *s, struct page *page) +static int check_slab(struct kmem_cache *s, struct slab *slab) { int maxobj; - if (!PageSlab(page)) { - slab_err(s, page, "Not a valid slab page"); + if (!folio_test_slab(slab_folio(slab))) { + slab_err(s, slab, "Not a valid slab page"); return 0; } Can't we guarantee that struct slab * always points to a slab? for struct page * it can be !PageSlab(page) because struct page * can be other than slab. but struct slab * can only be slab unlike struct page. code will be simpler if we guarantee that struct slab * always points to a slab (or NULL). # mm/slub: Convert pfmemalloc_match() to take a struct slab It's confusing to me because the original pfmemalloc_match() is removed and pfmemalloc_match_unsafe() was renamed to pfmemalloc_match() and converted to use slab_test_pfmemalloc() helper. But I agree with the resulting code. so: Reviewed-by: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> # mm/slub: Convert alloc_slab_page() to return a struct slab Reviewed-by: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Tested-by: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> # mm/slub: Convert print_page_info() to print_slab_info() Reviewed-by: Hyeonggon Yoo <42.hyeyoo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> I hope to review rest of patches in a week. Thanks, Hyeonggon > Changes in v4: > - rebase to 5.16-rc6 to avoid a conflict with mainline > - collect acks/reviews/tested-by from Johannes, Roman, Hyeonggon Yoo - > thanks! > - in patch "mm/slub: Convert detached_freelist to use a struct slab" > renamed free_nonslab_page() to free_large_kmalloc() and use folio there, > as suggested by Roman > - in "mm/memcg: Convert slab objcgs from struct page to struct slab" > change one caller of slab_objcgs_check() to slab_objcgs() as suggested > by Johannes, realize the other caller should be also changed, and remove > slab_objcgs_check() completely.