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 0A0B3C61CE8 for ; Mon, 9 Jun 2025 15:02:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9ADBA6B0096; Mon, 9 Jun 2025 11:02:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9857E6B0099; Mon, 9 Jun 2025 11:02:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 877EB6B00A1; Mon, 9 Jun 2025 11:02:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 66D796B0096 for ; Mon, 9 Jun 2025 11:02:10 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id F05BE1D43E3 for ; Mon, 9 Jun 2025 15:02:09 +0000 (UTC) X-FDA: 83536177578.20.AB8AF62 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id A61A31C0006 for ; Mon, 9 Jun 2025 15:02:07 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=gP9EvWq+; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749481328; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1TW5/EX1uIByMYpPlUTd3RK8aCzmnNLsk9YRhlGE5g0=; b=Twv/UcCfYw5B2cfQNrRpY3z+sACx3DGo1R7e5AXhxl95h8F94NQDZv4idY0Y34n2r/30SC sFR75aN3gP2h8jd7+PKkoVg5cgh44Ar1DSN+NkVB9xpp8Ib6xf3oLZJGdK8UIC+sEP5OSl 4pf3rB017Q3SS10994iEwf9N3PhSGLU= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=gP9EvWq+; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749481328; a=rsa-sha256; cv=none; b=wrhtgToUoe1UkiZK0ZiyLm7SjFIdBTCb5ZA2SrQZuXbCr84dtg3A6oKhgljf2vYEGsUCVE JU2kf0wfI6Qla6FC2qtTLDYnZeRU3G0WvLkIQUc5Pnfah0heL+yn/35CoUUkC7DmfGHxFd erDXBnZlctNMohOCeDsQwCd+qM/uc4Y= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1TW5/EX1uIByMYpPlUTd3RK8aCzmnNLsk9YRhlGE5g0=; b=gP9EvWq+hkz+yiJpee/Y9161t/ ajTs3ri4Lm/Uhal72zKuKpRof/y9u8hTvnYm9Jfp+CPCMiEBlT/C5OZqzU/Y5UtotkKAWSl6lUm2Z REvHz+EvRjX4Kx89nAICcc+IQYxzhiik6iZkphY4rHONvY2xJ7IFJU/1J3nf1M2SugU/5srdjo0vX NHHKUQKm9o+GzIqNgnUlOhM4Y6n/k7T4VxZZBH6SLgCSqNGrTXiCnTa5mABQEiEo3ga3w6qHw2V/H IsSKKl4GZYgWJY29K7MjQGtQYI6POc82F3bZzong8wW0pE7RVpdiglWKuodW/LObQoel4qRxyRfqM jr2W00Hg==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1uOe0i-00000008KyD-45bi; Mon, 09 Jun 2025 15:02:05 +0000 Date: Mon, 9 Jun 2025 16:02:04 +0100 From: Matthew Wilcox To: Vlastimil Babka Cc: Christoph Lameter , David Rientjes , linux-mm@kvack.org, Harry Yoo , kasan-dev , Alexander Potapenko , Marco Elver , Dmitry Vyukov Subject: Re: [PATCH 08/10] kfence: Remove mention of PG_slab Message-ID: References: <20250606222214.1395799-1-willy@infradead.org> <20250606222214.1395799-9-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: ha8kspmk5r98e3u1y9cgw6xx9fpsjcs3 X-Rspamd-Queue-Id: A61A31C0006 X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1749481327-727120 X-HE-Meta: U2FsdGVkX19o4t1cLZUk7mXM2hBX6sF+7cPbKQciMXPm70WbVN6cL5R1w5V5dhdd1YKbnZYwkeZgu3knEmjpf+riHpFTJC9rsfGlU7mg8dqq1eF+eqY6GGWjoZAdEOreFa3D+YakWLXOy6W81c+S334gqXxJPelzLHGv/2v1Z3IIQauwDtwClNlRxrykwMbY6yt/NocpIQ+fjZqwE0xOEP2CqdqJr0vLB2l19E5nsUHpK4pxNBGy06aPYQ4JHs8z/uMjlD8DYGlqw2/N1mO00jePo8B3Zjo4YDrhcXXdE88wb5SeVD84q+w+SXibKhfCYkM2OEFWZUr5jBzYyaYmb11JSwtR7JDVEjkp6wNdhIeH2fRTQOperCvNvj2WSkC8nmhbxlCUm4uSvzGjNTO0RzdGBcU8U4nslwdMAXUlWHVgTHjLsDl/AfS+qEbH7f1FRQSjJf7qdYBO5PM+lyXBGxKvBim/50qjEVFOrC7OJ3llT1O26QxRoCsBba/OU0Mf9tcyH8svKQfjotNm98TaL6AlpcblaiDMXyvtQckS9t6odR3aQjel+rc4Hg8VtXlCN03Pz3TIL2WXo+d/ZeBSRXEZXYrLhbdruCW2G2NQMof6C69eq+NwJ3UjYB8Zzcjqc/gWGZBpaKe5FgKlQzu4eEgAru3JQzVei/CJ2vSKEU+XVbEyw4oKaLGZ6zxpKlaNUnMctukkfzEw+pkHJ7qvll702GL2YIvKv0Ht3mwpwyNBt75ek5Gay2iKkA/s9slch6b8iRMBS4aQDvbMGaf6/nG++/WOzIB6wkbn5l8RLXan7I8z9V8nEiwh14Q97U2XOpkGxfEEZ4tag89e3Dmo4r+xJ7oc+mtHIKP+9xMOaHKClL6dbSsS2ReFow7+i/D5m8wurjGzOGZtyukQzwnN2xVmUE/OWC7Jw/gfuvjAklfSewdB0TzjjfscfpL66xUgGanjG4rojP5i6wuO35I BZBT4QOr W4+/bT/ImxtryP66fVIZ82oxSH3d1nezdFjFDUdVYgLcx3aEEQXiti+Zum7Xo2ZL2okxsPRRsNQc0GUvRCl49kNOpjwsp5oUZ/ykz2wOBOGG+I7XrQqY4w27VG8D0ePU0XrykCRAb8AAOkzKKeIPEwL3dS/WbaQFUzM+EyfsHLa+mpB1XFvz/s1ZMxiZmue3sYUBxmPFeHb4H+Ji7VIbuOp7xYiiCJI/kma1bm4fW+AjbLQ6QxcbmiH83C78qjG/sk3oE2C4nGKhApNP7OHQH0yuuoFXEa9xCfhd+CQF9AacaktrpQA7ouKVdzFeKgB5/+Bj0VOf4hdb+/bc= 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: List-Subscribe: List-Unsubscribe: On Mon, Jun 09, 2025 at 03:33:41PM +0200, Vlastimil Babka wrote: > On 6/7/25 00:22, Matthew Wilcox (Oracle) wrote: > > Improve the documentation slightly, assuming I understood it correctly. > > Assuming I understood it correctly, this is going to be fun part of > splitting struct slab from struct page. It gets __kfence_pool from memblock > allocator and then makes the corresponding struct pages look like slab > pages. Maybe it will be possible to simplify things so it won't have to > allocate struct slab for each page... I've been looking at this and I'm not sure I understand it correctly either. Perhaps the kfence people can weigh in. It seems like the kfence pages are being marked as slab pages, but not being assigned to any particular slab cache? Perhaps the right thing to do will be to allocate slabs for kfence objects. Or kfence objects get their own memdesc type. It's hard to say at this point. My plan was to disable kfence (along with almost everything else) when CONFIG_PAGE_DIET is enabled, and then someone who understands what's going on can come in and do the necessary to re-enable it. > > Signed-off-by: Matthew Wilcox (Oracle) > > --- > > mm/kfence/core.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/mm/kfence/core.c b/mm/kfence/core.c > > index 102048821c22..0ed3be100963 100644 > > --- a/mm/kfence/core.c > > +++ b/mm/kfence/core.c > > @@ -605,8 +605,8 @@ static unsigned long kfence_init_pool(void) > > pages = virt_to_page(__kfence_pool); > > > > /* > > - * Set up object pages: they must have PG_slab set, to avoid freeing > > - * these as real pages. > > + * Set up object pages: they must have PGTY_slab set to avoid freeing > > + * them as real pages. > > * > > * We also want to avoid inserting kfence_free() in the kfree() > > * fast-path in SLUB, and therefore need to ensure kfree() correctly >