Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1343677rdb; Wed, 6 Dec 2023 16:31:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMBQoYbVVnB+XAoJn0+a58QdOgYddRYbHGxy4cNLA2faO0FE54AZDTRDekLCWGCiv151Ko X-Received: by 2002:a05:6a20:e609:b0:18f:9c4:d339 with SMTP id my9-20020a056a20e60900b0018f09c4d339mr4574175pzb.41.1701909081040; Wed, 06 Dec 2023 16:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701909081; cv=none; d=google.com; s=arc-20160816; b=uLcmbMySoy8Ty2dXzvUiNbHtTg5lHi/vurlYIxDPfGsZwfNIHkAmJMI7wc1vEBlE9w M6IOKSCI4m8Giivk7vtd2n8etFpuCArkDaMg6Nyk8LWACqv28cVj59Zedy1Cj6ezTpLM WzDqZjho9h5n0uW93KqLCbEXuC3HIiV+dEjGFC4+R9OuACpkv4T8TJ5LpRx7f7sXMwfM YdDb7hNnWUykYyt0UI85Oe5mjJ/6iqFsKvRnlYmpy2r//oBEasSBBxifAR5y+aQGEY6g J9DrGdu/ZVCrO0NlbassJCfA4+B+H5hxoH0EIrb4g0jfuaQZqMQLjPCEHX+37Ofh96q7 Z6Xw== 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=pUILdXO0fAmIum4i0LjaIhGHTq4M4euUAAZGlBJTfMI=; fh=ezGgTJoHdqijbJ6IWHiSjHZUYI0p+VPBCX/sPRmQd+E=; b=o0LguOHZGGmHySGjadpaGXhRtwO2ng+kqvlA+IrRUtBAy64eyA/6568ZtsqQgbAY5q ZegcKZaydJyDrmlw6JRAL8YzGw5TWOY7Bz0pZjb7ZeX/IVEXsMr+XCog9EQB0Wgy6JZI e6JiVxZCPm+5nZjmTPK6M26cBfaWBpWjYiySgsJ2HOMuG1Fo/gRIlX0THrBNvy/vQrv9 oLlbw1DZFtu72VXObF8bJtVgbTC+3e+2slNkpFxjUlgBihpvm4knPCFcohF9Yyg3Ni5l LzwsBPJxS18th8De6NJYauqq84L5GE6OWPrYbY7jr/T4Io3mPkXAw0BcO05xq+w8FT7F f6Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UVkDLPJY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id b2-20020a63eb42000000b005c6676349ffsi142243pgk.613.2023.12.06.16.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 16:31:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UVkDLPJY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 661E883EB322; Wed, 6 Dec 2023 16:31:17 -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 S232043AbjLGAay (ORCPT + 99 others); Wed, 6 Dec 2023 19:30:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231264AbjLGAax (ORCPT ); Wed, 6 Dec 2023 19:30:53 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 329091736; Wed, 6 Dec 2023 16:30:31 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6cbd24d9557so78150b3a.1; Wed, 06 Dec 2023 16:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701909030; x=1702513830; 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=pUILdXO0fAmIum4i0LjaIhGHTq4M4euUAAZGlBJTfMI=; b=UVkDLPJYiku3Z/fo/QgPMrxc6kDRoov/cHWzBBepkOK/TFxjbFqDA+3SlZC8Lga89h kp/9lKXuMzTjHUDJmYT3I7KvO9+/D/cdqGBcO1mD1zFg67X3BslaEdgZNbZS9bqmjQMZ oWZEG/AgshzfdwLVGk2tB4cSqrLg/mvays2NhZ3KMXJy3S5Dd8XIC8WoXhcEydYpBlb2 b2NzUC6n2sYnAv5SGyciV2GAQxQU3qDueyRzj2uBK/x/l8s+QA4xkm5KEh/mMXNTwEfu +pH/oEuGsWzWm5EsVxt8wxgCbI2f8YV2YrLhQjWp4rAIVOnP9Y6ceApY6KPOaCCgv2Bs B5Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701909030; x=1702513830; 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=pUILdXO0fAmIum4i0LjaIhGHTq4M4euUAAZGlBJTfMI=; b=E7Qabj6S23/cy9FIOC9DvMjGtGU12+FhIIymtrlV3RKb9v4tMY9e75zgUFj9pXgu6/ +fWAS7thFtNxX1rx3LPncxJcygrv6oI/h7RvyGmMDRZeLKOsB5qOPtGmc11YWYhTC2xm UIGL/DegYmA3nVVB3yBtSKAj/0SU3dwOMWZDTFmTSw3QCEOKbI70hpYWcim4GCJ1czFm ugZueyBRWqHDIYle51TyYSa+Vg8chpvV4osupfdBdrzFIuhiwkAft07jO2SKF0SPh7On 2oRJ3vKqSxRNygZ0njPcCJPReQQTQtBMiTR1FyBTwSEkfuW+BW6Z71ova6ANoVTQVKmc veXg== X-Gm-Message-State: AOJu0Yzsu8kD9E1L4tQ43UfPp67Z71TxDWiv38zIkEDlO9IrRZiE/3ji LRMDc+Z3+aQRqdbESWRjcTU= X-Received: by 2002:a05:6a00:3a1a:b0:68f:a92a:8509 with SMTP id fj26-20020a056a003a1a00b0068fa92a8509mr4897945pfb.7.1701909030344; Wed, 06 Dec 2023 16:30:30 -0800 (PST) Received: from localhost.localdomain ([1.245.180.67]) by smtp.gmail.com with ESMTPSA id n19-20020aa78a53000000b006ce7d0d2590sm120723pfa.0.2023.12.06.16.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 16:30:29 -0800 (PST) Date: Thu, 7 Dec 2023 09:30:15 +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 12/21] mm/slab: consolidate includes in the internal mm/slab.h Message-ID: References: <20231120-slab-remove-slab-v2-0-9c9c70177183@suse.cz> <20231120-slab-remove-slab-v2-12-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-12-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 16:31:17 -0800 (PST) On Mon, Nov 20, 2023 at 07:34:23PM +0100, Vlastimil Babka wrote: > The #include's are scattered at several places of the file, but it does > not seem this is needed to prevent any include loops (anymore?) so > consolidate them at the top. Also move the misplaced kmem_cache_init() > declaration away from the top. > > Signed-off-by: Vlastimil Babka > --- > mm/slab.h | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > > diff --git a/mm/slab.h b/mm/slab.h > index 3a8d13c099fa..1ac3a2f8d4c0 100644 > --- a/mm/slab.h > +++ b/mm/slab.h > @@ -1,10 +1,22 @@ > /* SPDX-License-Identifier: GPL-2.0 */ > #ifndef MM_SLAB_H > #define MM_SLAB_H > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > /* > * Internal slab definitions > */ > -void __init kmem_cache_init(void); > > #ifdef CONFIG_64BIT > # ifdef system_has_cmpxchg128 > @@ -209,11 +221,6 @@ static inline size_t slab_size(const struct slab *slab) > return PAGE_SIZE << slab_order(slab); > } > > -#include > -#include > -#include > -#include > - > #ifdef CONFIG_SLUB_CPU_PARTIAL > #define slub_percpu_partial(c) ((c)->partial) > > @@ -347,14 +354,6 @@ static inline int objs_per_slab(const struct kmem_cache *cache, > return slab->objects; > } > > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > /* > * State of the slab allocator. > * > @@ -405,6 +404,7 @@ gfp_t kmalloc_fix_flags(gfp_t flags); > /* Functions provided by the slab allocators */ > int __kmem_cache_create(struct kmem_cache *, slab_flags_t flags); > > +void __init kmem_cache_init(void); > void __init new_kmalloc_cache(int idx, enum kmalloc_cache_type type, > slab_flags_t flags); > extern void create_boot_cache(struct kmem_cache *, const char *name, Looks good to me, Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> > > -- > 2.42.1 > >