Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1359067rdb; Wed, 6 Dec 2023 17:11:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IF19hjyBBVjynTMYtJuxwSToxENntvzdGFHDCBVlqKB9eIkIMz5Ra83aBJ0aZ2YO8uf3HxC X-Received: by 2002:a17:90b:1b43:b0:288:67f6:2cd3 with SMTP id nv3-20020a17090b1b4300b0028867f62cd3mr1660432pjb.43.1701911491650; Wed, 06 Dec 2023 17:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701911491; cv=none; d=google.com; s=arc-20160816; b=ltTOZgU8+D7F/oIpLPceYsvW1a07mqHVfoegrIMcTjk9QxYC3qn+2bUUYijusoLBTQ 1i+JdyODinJqPwTo7E3lTBgdSHgT7AG1azIgBCuV8mSDy8AVPJeVKOc7FEy0xEgrBcxo 7cwVGIjJfhplv/3B0EkW2K1Ihr84Lk6aLsOovphSnU5Dd5WbJ+GDh1KQXBB9tPNZShQH 5DDdu0cMpqS4nnufC5dYSIg2xoWbOe4+ReC118OcC8jAhk/jyhdyVtCqf1l8iyOU+oNr yrZsjI0DusUumL8C7HqqrPkezqZ3AUcm0gq1qv7uhRJ2kYyGhGcxplvaPxSRyuShb1ws kGEw== 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=O2iQ4GZaNaP4TLuVf9scG6OMfAEhFr0GcB530VPLhoU=; fh=ezGgTJoHdqijbJ6IWHiSjHZUYI0p+VPBCX/sPRmQd+E=; b=ewl1lrmNIMgnhkeJfTMVfZANGsMe0Fuh4JlxUxBpW76DLhISPej/0OH/+4nnweSrRC PcmqTBKLNyF7qilWA6mYyOnfOE/EBjMQmeCkhvHT8utbKtZCXRvsYIhN2y6adXIleBb+ YieeKwqycBrnaUMaxglLFPalHEocBWTr2CbMsU5FyZKf2xjK3p8wMaf5EfwuxHAlVTqR pqcXg7Ah/u89EKc+/8ViE0c9Wltv9MguGDEL4PQAmr6mK7xTy8qU/sDLSPw+g6yg6X+s Ob2buPhWzWrN40Ta5PDnyoEfJjNEe+IThvZM6n7Hc30ZC9CLQlq1JZTQR4hJqTfQuErN 5PVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mc2XVfQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id t18-20020a17090aba9200b00286e9e44534si138787pjr.38.2023.12.06.17.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 17:11:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mc2XVfQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 0641D83EB337; Wed, 6 Dec 2023 17:11:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441967AbjLGBLO (ORCPT + 99 others); Wed, 6 Dec 2023 20:11:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441961AbjLGBLM (ORCPT ); Wed, 6 Dec 2023 20:11:12 -0500 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F00B10D; Wed, 6 Dec 2023 17:11:19 -0800 (PST) Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-5906eac104bso80758eaf.2; Wed, 06 Dec 2023 17:11:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701911478; x=1702516278; 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=O2iQ4GZaNaP4TLuVf9scG6OMfAEhFr0GcB530VPLhoU=; b=mc2XVfQO1QHhrSD+ppXwi5+S8WGod3W/y74JxPD52WcjvSFjIEZhCG7cnX7qZtVMRM vsHq2uqVAdp4otTfWuS4WFFBkb5kpgMLYJOiV79dHXB0OCyVNBD20fWg9sW6UK9JrQ/A cUCxvqyh7tiSri3UoRKiPhNHXrcPofCU+GKI818g8Eum3zGyMq9BDl2KgUM5zIhA3NgY fshV58sz9U2hfpyPnO9M21AogCdaR4aJUzIDmsu8mHRcldevgKZNVpSXftH4zYyhvXas 83NAdbG0YXt6wFahhJBM4hNnwqyEhLh9yPHGZfhS60PaBpS3FmNkZmxamUpk4ugtOyhN ekVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701911478; x=1702516278; 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=O2iQ4GZaNaP4TLuVf9scG6OMfAEhFr0GcB530VPLhoU=; b=rUSanU991ZVB7yammGONyQ5ymVR1/ZWc3arJnnG0n+j7sdAJlkaoaZ/6M605vNf9uP /Hb1x5Me+l1SrfLRwEcKL2ZeMcwx+gslHwgs9yG5S8DrGMhhFSciz14momx9z7Omwpr6 gY4+NrilFYQw8jqDqqIvjdT09PuRag4vwQSYKjNFxVVeMNv09gHoev059CpNqAFiwnPs oZeSp2+OF+0tacrhu72qBQXhsVVcLRXfeRSOdgXCa02u+1KDiQEJasWMvkxuWA6URzXG f4/phFkHOzr2/p/EOmmWTLH2ULl7BLh0kJKm7hY4dAxNyeOwxWc9fDGyS8hnELchZeD2 Z2Ww== X-Gm-Message-State: AOJu0YxNBAL+yeqFm+y6WFpzhJmclgRHFCOikdxliuiXXu3GZfbWWzzf LPwiCL+4G3Bqst66N+PFPK8= X-Received: by 2002:a05:6358:4320:b0:16e:27b5:3b25 with SMTP id r32-20020a056358432000b0016e27b53b25mr1981299rwc.31.1701911478109; Wed, 06 Dec 2023 17:11:18 -0800 (PST) Received: from localhost.localdomain ([1.245.180.67]) by smtp.gmail.com with ESMTPSA id p2-20020aa78602000000b006be5af77f06sm141705pfn.2.2023.12.06.17.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 17:11:17 -0800 (PST) Date: Thu, 7 Dec 2023 10:11:02 +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 15/21] mm/slab: move struct kmem_cache_node from slab.h to slub.c Message-ID: References: <20231120-slab-remove-slab-v2-0-9c9c70177183@suse.cz> <20231120-slab-remove-slab-v2-15-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-15-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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 06 Dec 2023 17:11:29 -0800 (PST) On Mon, Nov 20, 2023 at 07:34:26PM +0100, Vlastimil Babka wrote: > The declaration and associated helpers are not used anywhere else > anymore. > > Reviewed-by: Kees Cook > Signed-off-by: Vlastimil Babka > --- > mm/slab.h | 29 ----------------------------- > mm/slub.c | 27 +++++++++++++++++++++++++++ > 2 files changed, 27 insertions(+), 29 deletions(-) > > diff --git a/mm/slab.h b/mm/slab.h > index a81ef7c9282d..5ae6a978e9c2 100644 > --- a/mm/slab.h > +++ b/mm/slab.h > @@ -588,35 +588,6 @@ static inline size_t slab_ksize(const struct kmem_cache *s) > return s->size; > } > > - > -/* > - * The slab lists for all objects. > - */ > -struct kmem_cache_node { > - spinlock_t list_lock; > - unsigned long nr_partial; > - struct list_head partial; > -#ifdef CONFIG_SLUB_DEBUG > - atomic_long_t nr_slabs; > - atomic_long_t total_objects; > - struct list_head full; > -#endif > -}; > - > -static inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node) > -{ > - return s->node[node]; > -} > - > -/* > - * Iterator over all nodes. The body will be executed for each node that has > - * a kmem_cache_node structure allocated (which is true for all online nodes) > - */ > -#define for_each_kmem_cache_node(__s, __node, __n) \ > - for (__node = 0; __node < nr_node_ids; __node++) \ > - if ((__n = get_node(__s, __node))) > - > - > #ifdef CONFIG_SLUB_DEBUG > void dump_unreclaimable_slab(void); > #else > diff --git a/mm/slub.c b/mm/slub.c > index 844e0beb84ee..cc801f8258fe 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -396,6 +396,33 @@ static inline void stat(const struct kmem_cache *s, enum stat_item si) > #endif > } > > +/* > + * The slab lists for all objects. > + */ > +struct kmem_cache_node { > + spinlock_t list_lock; > + unsigned long nr_partial; > + struct list_head partial; > +#ifdef CONFIG_SLUB_DEBUG > + atomic_long_t nr_slabs; > + atomic_long_t total_objects; > + struct list_head full; > +#endif > +}; > + > +static inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node) > +{ > + return s->node[node]; > +} > + > +/* > + * Iterator over all nodes. The body will be executed for each node that has > + * a kmem_cache_node structure allocated (which is true for all online nodes) > + */ > +#define for_each_kmem_cache_node(__s, __node, __n) \ > + for (__node = 0; __node < nr_node_ids; __node++) \ > + if ((__n = get_node(__s, __node))) > + > /* > * Tracks for which NUMA nodes we have kmem_cache_nodes allocated. > * Corresponds to node_state[N_NORMAL_MEMORY], but can temporarily > > -- Looks good to me, Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > 2.42.1 > >