From nobody Tue Dec 30 18:49:27 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35373C4332F for ; Mon, 13 Nov 2023 19:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231879AbjKMTOW (ORCPT ); Mon, 13 Nov 2023 14:14:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231240AbjKMTOP (ORCPT ); Mon, 13 Nov 2023 14:14:15 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6FC210EC; Mon, 13 Nov 2023 11:14:11 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 65BE321907; Mon, 13 Nov 2023 19:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1699902850; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gc35dnOv0z/EAYeff3HVhELHQaD+6wOr4+QtkQBoL1I=; b=EDCJw7/roK4MJaGkU14p7h8EBhfXYzuP/WlUFEOe2dGtZqjNUnSMvScfIAJ/FO52DWZDaL Z6cDhB/GmQZv5YJ93bBTADu1UCCBIiMFtj4b91Cd6Z21fEm1cvG/1oK7AvA5EJyi/sZlLf L6O1lt8kY6UFrTSPoc/K3pmMj1MvuFQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1699902850; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gc35dnOv0z/EAYeff3HVhELHQaD+6wOr4+QtkQBoL1I=; b=XvG+/Cd6vmoYcWYk3ojvTjgGdjVWUVN4PHtt2WQD4hTve7EG627AAqQ5PhHtvnSmcWmdgp L+huqwPyRsV05aBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 040D313907; Mon, 13 Nov 2023 19:14:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eJtLAIJ1UmVFOgAAMHmgww (envelope-from ); Mon, 13 Nov 2023 19:14:10 +0000 From: Vlastimil Babka To: David Rientjes , Christoph Lameter , Pekka Enberg , Joonsoo Kim Cc: Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Marco Elver , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Kees Cook , kasan-dev@googlegroups.com, cgroups@vger.kernel.org, Vlastimil Babka Subject: [PATCH 03/20] KFENCE: cleanup kfence_guarded_alloc() after CONFIG_SLAB removal Date: Mon, 13 Nov 2023 20:13:44 +0100 Message-ID: <20231113191340.17482-25-vbabka@suse.cz> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231113191340.17482-22-vbabka@suse.cz> References: <20231113191340.17482-22-vbabka@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Some struct slab fields are initialized differently for SLAB and SLUB so we can simplify with SLUB being the only remaining allocator. Signed-off-by: Vlastimil Babka Reviewed-by: Kees Cook Reviewed-by: Marco Elver --- mm/kfence/core.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/kfence/core.c b/mm/kfence/core.c index 3872528d0963..8350f5c06f2e 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -463,11 +463,7 @@ static void *kfence_guarded_alloc(struct kmem_cache *c= ache, size_t size, gfp_t g /* Set required slab fields. */ slab =3D virt_to_slab((void *)meta->addr); slab->slab_cache =3D cache; -#if defined(CONFIG_SLUB) slab->objects =3D 1; -#elif defined(CONFIG_SLAB) - slab->s_mem =3D addr; -#endif =20 /* Memory initialization. */ set_canary(meta); --=20 2.42.1