Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp813158rdb; Wed, 6 Dec 2023 00:01:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFGPnwWY3OVJCVcSFxEEgQhPq7eVuPAEyEp0+c8TZxqJZi8aKa1u1IPqNsARgRMBnxMrB4 X-Received: by 2002:a05:6a20:394e:b0:187:4cf5:f171 with SMTP id r14-20020a056a20394e00b001874cf5f171mr323486pzg.2.1701849714093; Wed, 06 Dec 2023 00:01:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701849714; cv=none; d=google.com; s=arc-20160816; b=y5Bs1pzhYbZy4ZXekX3RGDf+djHlscp7KkpnueVlnnsy98po187zETIzHZyPO+Ccsn lysnz7zhY8ujc9Tjwsf3JTU6seamQmYCT3F/HmvBIGl8+4ZuRgypW0gjayvm811wcqN4 dtjizaum/XQkO5drutLV+5T2GF0U4J2GzR0+0F4F/GYzhdzPjflhAQiaZwXuig7g0VZS 2XEcM8Oad9Y9fWZWLAnth9+GuqXo4omhtnya6hnD+CucaYGfgGQff0xEkwUfkYoXbdNi WdGKuRqjF4iSP3XTxstqP+NDkj+HoaAF++FpcHTsRZLZdxAYhW6m7+uZbtsC2O6tX+HA CUsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NsJi+rAf1/pjE2JHoHBlEmIyNC7axeV0xxI+MHCEAm4=; fh=ezGgTJoHdqijbJ6IWHiSjHZUYI0p+VPBCX/sPRmQd+E=; b=zxqlOC0I/kSywqiNhYg6jBN44pT9zNywSW70c1yoCUCHeUOH22LWhKUEz6dT+QWs66 FoTYOIwE8PFO45b73xKJvIK2QlRMHKAv2r+n8j26HBibWlWjdH3CirZ3U17PiPvXpOUy uJoy83I2qyPe6JcgGLuWXCSvQvkQij6P0iBu1dKXQGiM+5oGrRnX7j7NtDUNgCQ3uRU6 GGENXNP4fnG6L4uctfGiycjy8cHuTLnWuVpotX+5w1tlKKcXtJ+hRazK7jpn8R9w0ql6 w/kcxUtDeNofAuPeu0SgfPQMOUp5BXsnDtK+BrZCRFYnTRvi5GtAwT7eqKOE+hC1L9yl FGQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fP0yvDmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id q7-20020a634307000000b0056952b496efsi11050031pga.366.2023.12.06.00.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 00:01:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fP0yvDmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 37A08802FABA; Wed, 6 Dec 2023 00:01:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376772AbjLFIBh (ORCPT + 99 others); Wed, 6 Dec 2023 03:01:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjLFIBg (ORCPT ); Wed, 6 Dec 2023 03:01:36 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77F9E18D; Wed, 6 Dec 2023 00:01:43 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1d06819a9cbso28244085ad.1; Wed, 06 Dec 2023 00:01:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701849703; x=1702454503; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NsJi+rAf1/pjE2JHoHBlEmIyNC7axeV0xxI+MHCEAm4=; b=fP0yvDmxQqRudG4Pdu43JNlIHNl9YH7IUUsIrL+vM/acSlwTUDKOpC2/GgO7dcqfwP TdwAq0zLRodGjfs7mk/dPMpTqYtIx2NMNO/XS1OUGKF/M+cZPsjPOoV+eX9NBBp6hPyZ eaLv+yP4tvQj/xYuWPrgkREF8lhtTKcBvb3u/51d2LKzzxiIcqese8kWAtLME5LqdLtT Ne+3yJGsJRi95r86O9k66hJ8NTh2Gb++mPoDhOFYCQRmbE8HXRHdHLEtbTG5rTNz6Az3 EuTzmhRPCNdrwUn0hRjgyZz3hCDDjhioI/SfN9l7Il6QaF64JQwEp28XHcm7OEw6OFlW ZJZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701849703; x=1702454503; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NsJi+rAf1/pjE2JHoHBlEmIyNC7axeV0xxI+MHCEAm4=; b=Pu+GXrPxVL6DrtfTiBaeLoL8F1Vwk50ArC1h6DjzzygGmqZJE97W1v2tcJFrV5pjoF nAoBsNCe5+dB7x0pLupdqiwmuhrOeiNLimU5SQnYFx0IlSNdSEedwrLh3qlwtoKjcZef GVqohVuL5OO8wAFvFpbSY5KuBpJ8s0X+nxYyqWipzztkE3I6yqnU0dyjRi0xqYee9e0x ahICLvzxLlkJnIoov323swCcg9aXUTJo9dTz3v9Drmn7RIw7pYyouyILzzdlDHxcUzRS aXebGDvTSSigQOMLXMa0mS3sC+qg5OgXWb4uM113EhecRzfNnzPeKBx0CIw3cdg/M+OB DyUg== X-Gm-Message-State: AOJu0YzpWb1bdnKVDxrklF70S1vpHRgpiUbaRnKtY22fSBhbwCn21NjQ cVN8/pwWp/m5SRsMd2QFw14= X-Received: by 2002:a17:903:1208:b0:1d0:6ffd:ae04 with SMTP id l8-20020a170903120800b001d06ffdae04mr321640plh.107.1701849702755; Wed, 06 Dec 2023 00:01:42 -0800 (PST) Received: from localhost.localdomain ([1.245.180.67]) by smtp.gmail.com with ESMTPSA id x4-20020a170902ec8400b001d08bbcf78bsm5976368plg.74.2023.12.06.00.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 00:01:41 -0800 (PST) Date: Wed, 6 Dec 2023 17:01:27 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: David Rientjes , Christoph Lameter , Pekka Enberg , Joonsoo Kim , Andrew Morton , Roman Gushchin , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Marco Elver , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 04/21] KFENCE: cleanup kfence_guarded_alloc() after CONFIG_SLAB removal Message-ID: References: <20231120-slab-remove-slab-v2-0-9c9c70177183@suse.cz> <20231120-slab-remove-slab-v2-4-9c9c70177183@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231120-slab-remove-slab-v2-4-9c9c70177183@suse.cz> X-Spam-Status: No, score=0.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 06 Dec 2023 00:01:51 -0800 (PST) On Mon, Nov 20, 2023 at 07:34:15PM +0100, Vlastimil Babka wrote: > Some struct slab fields are initialized differently for SLAB and SLUB so > we can simplify with SLUB being the only remaining allocator. > > Reviewed-by: Kees Cook > Reviewed-by: Marco Elver > Signed-off-by: Vlastimil Babka > --- > 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 *cache, size_t size, gfp_t g > /* Set required slab fields. */ > slab = virt_to_slab((void *)meta->addr); > slab->slab_cache = cache; > -#if defined(CONFIG_SLUB) > slab->objects = 1; > -#elif defined(CONFIG_SLAB) > - slab->s_mem = addr; > -#endif > > /* Memory initialization. */ > set_canary(meta); Looks good to me, Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > -- > 2.42.1 > >