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 6E37DC433F5 for ; Sat, 25 Dec 2021 09:17:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 942FF6B0071; Sat, 25 Dec 2021 04:17:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F2A46B0072; Sat, 25 Dec 2021 04:17:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BB5E6B0073; Sat, 25 Dec 2021 04:17:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0248.hostedemail.com [216.40.44.248]) by kanga.kvack.org (Postfix) with ESMTP id 6DEC16B0071 for ; Sat, 25 Dec 2021 04:17:07 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 187498249980 for ; Sat, 25 Dec 2021 09:17:07 +0000 (UTC) X-FDA: 78955762494.06.BE79D67 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by imf19.hostedemail.com (Postfix) with ESMTP id AF99B1A0019 for ; Sat, 25 Dec 2021 09:17:06 +0000 (UTC) Received: by mail-pl1-f170.google.com with SMTP id c7so7998493plg.5 for ; Sat, 25 Dec 2021 01:17:06 -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=j8TrOsw0QgcOPU1it/XtIDhHHO12dds110STZzwzYD0=; b=nOfcDm4R5YmmsgOzRMD28sPCqa+TwQDAQHfEwt3dW/ogm2rgFf/ajmkB4ScNuPhyO8 vYbJwRK0IZSKimBi3gea8Oje+/59Z+0N6771bKnQRHOPYgG0nV5O3ZG7v8mbs1axOAGL G+qJ4RNKx03TigPLiGc18Rfr8Tekoumv1fh6eY6ElmMFViRIArxRcUUDaxqriuwSKbep aHEYUZxo1aUj7I0wrJ0eHssFN6dTHiyDQT0tqulG//pf997KhiOJDjAnKMwINw04gyQ1 7SPueCO4+F38JtWp128b+dPBIVb22KtU1MqSpIOk9k85uyu5uIhMGcIwIXKUCBRmUlek 2Anw== 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=j8TrOsw0QgcOPU1it/XtIDhHHO12dds110STZzwzYD0=; b=eEND/WrxeMcINszr3MY5ehaa1c8T4/LOAbFxGzoJbCUQU9mIDud9A+M43HQW+t5NI5 00tLaXu9BYLA7vL3j89CNEzMnpRcAGMjxVhPT6SqGkbQRfnnZLED1ghxBJAjOv8PHUzP 5T/T43VYtFNDJHTteyddNWonl2Kye3KuIIlJuhVCL/Ky7Sw0YAZOAXDtubeEiDFACwpp PnF5h4neCVAh8Yw034VGfNF7GSlK+QXD/oHXls0+8E7LmnhezdmUvS/kTf/38Ro5l/mE cXsIsbr7GqpVHZFnKuOsIodctLhaenFUAN4pAsms5RHVKHbzVsefzsluHO/PBsb1ThgP JBkw== X-Gm-Message-State: AOAM532HFZQvTLrIbCI94zf+hZWC8Ppr5OXUaoqr4B95Lnoy/xrVYCig EH4hQ9UG3B+OKPFOsFMpGwA= X-Google-Smtp-Source: ABdhPJz9jlowVnaWF5WFDxgb4hC4jKXBJ9R7DZT7d9Gt8MbbdXuDlBdTHBahWN62xgb0xOPaqu1h7Q== X-Received: by 2002:a17:903:2303:b0:149:50d1:19d0 with SMTP id d3-20020a170903230300b0014950d119d0mr9507103plh.86.1640423825603; Sat, 25 Dec 2021 01:17:05 -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 t10sm11886406pfg.105.2021.12.25.01.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Dec 2021 01:17:05 -0800 (PST) Date: Sat, 25 Dec 2021 09:16:55 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=nOfcDm4R; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.170 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: AF99B1A0019 X-Stat-Signature: qqf8xuy3ssb1crxfzpy9xxfpjnrp1thh X-HE-Tag: 1640423826-336304 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 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 Vlastimil, Merry Christmas! This is part 2 of reviewing/testing patches. # mm/kasan: Convert to struct folio and struct slab I'm not familiar with kasan yet but kasan runs well on my machine and kasan's bug report functionality too works fine. Tested-by: Hyeongogn Yoo <42.hyeyoo@gmail.com> # mm: Convert struct page to struct slab in functions used by other subsystems I'm not familiar with kasan, but to ask: Does ____kasan_slab_free detect invalid free if someone frees an object that is not allocated from slab? @@ -341,7 +341,7 @@ static inline bool ____kasan_slab_free(struct kmem_cache *cache, void *object, - if (unlikely(nearest_obj(cache, virt_to_head_page(object), object) != + if (unlikely(nearest_obj(cache, virt_to_slab(object), object) != object)) { kasan_report_invalid_free(tagged_object, ip); return true; I'm asking this because virt_to_slab() will return NULL if folio_test_slab() returns false. That will cause NULL pointer dereference in nearest_obj. I don't think this change is intended. This makes me think some of virt_to_head_page() -> virt_to_slab() conversion need to be reviewed with caution. # mm/slab: Finish struct page to struct slab conversion Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> # mm/slab: Convert most struct page to struct slab by spatch Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> I'll come back with part 3 :) Enjoy your Christmas! 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.