From patchwork Mon Nov 13 19:13:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13454367 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 80482C4332F for ; Mon, 13 Nov 2023 19:14:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2AC836B0277; Mon, 13 Nov 2023 14:14:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DBD2A6B0278; Mon, 13 Nov 2023 14:14:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 786166B027A; Mon, 13 Nov 2023 14:14:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 41FB06B027A for ; Mon, 13 Nov 2023 14:14:17 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 11E89160622 for ; Mon, 13 Nov 2023 19:14:17 +0000 (UTC) X-FDA: 81453881754.04.AF281AB Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf07.hostedemail.com (Postfix) with ESMTP id 1DA4240004 for ; Mon, 13 Nov 2023 19:14:14 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=X1zStBcu; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=7Ue2H1I0; dmarc=none; spf=pass (imf07.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699902855; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0Pl3hBxZTqS7t6wbtH0Om8A7aicbQgQuPXay4H9gSiM=; b=2/icE7yvuUm3vBq3K18kXc9VeFoqThPfWK8OEuTM+IIBYEAeHFdBWpivPT8LqQHR9J/3IG ziUyjmmmTZ7n+YX9p22/VPbL5YX7fW/ISsFshb/R7BhUtRBVu9icNuxvQzl4F252JrSQ4F V4BB9VX5csjhw7FFWuH8On1v5AUfDxo= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=X1zStBcu; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=7Ue2H1I0; dmarc=none; spf=pass (imf07.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699902855; a=rsa-sha256; cv=none; b=FZDEKUu7lVwy3ftphLlX4vHCcWRNGejo4oNn2njl6Fv8xjlouK3ayxs5H6G8nu1p/r2dOh k+iKWKnT+lStqzEtMItQvKOp4iH6avAic5NEbYRzs7zXQkUKxtqmRiwBsexeKYeRxybONP H7ahaTguf0PFZz+X2QbrsynEv6hK1Vw= 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-out2.suse.de (Postfix) with ESMTPS id 37E401F88D; Mon, 13 Nov 2023 19:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1699902853; 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=0Pl3hBxZTqS7t6wbtH0Om8A7aicbQgQuPXay4H9gSiM=; b=X1zStBcucLDp7WpLf93CvypzJkg224MuMGfGMtRudRFzgQHf18v/tbV1wyz1utEH4Kx9ur 5teIxEU6gfdFQSp3bqY6arFrcdOdBAZsHhrOLN9IkEWofP509kx075uiTpHKfdsSP1f/ei OFSLSHBOTKxRVbmTKpn0mOziI7DX8vY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1699902853; 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=0Pl3hBxZTqS7t6wbtH0Om8A7aicbQgQuPXay4H9gSiM=; b=7Ue2H1I0sTX6CLyuq/0bLGA2DY+hI6S3LLF/VGrteCc7gKBnRxO0qsOahDmsdbPnwvPhcw zEwQvnlEhvqMysCg== 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 DCED513907; Mon, 13 Nov 2023 19:14:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OPcxNYR1UmVFOgAAMHmgww (envelope-from ); Mon, 13 Nov 2023 19:14:12 +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 11/20] mm/slab: consolidate includes in the internal mm/slab.h Date: Mon, 13 Nov 2023 20:13:52 +0100 Message-ID: <20231113191340.17482-33-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 X-Rspam-User: X-Stat-Signature: i1ybrqmgatjo4wuiziq1wko37xjj11tq X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 1DA4240004 X-HE-Tag: 1699902854-894756 X-HE-Meta: U2FsdGVkX19LYHvnZOUyH2xDz+V6RItgraj94b60hbLuQrfIhEY2KugDlwdR5/i7nSfzSIU66sN5mFE+swkABSom8jpbjGeMQsGHtabXn5TlzNpq9lP8aasLya7J8fEvozEu43wBsAiZBKmtJjCQJWxiY5SKuVYNIl+0gt2l2MBR1JfaiswlxhRAuOftt38U/8l8UdfvbbWT11PjMSp8ynp4mYoA9bS2YPkZ/XExoDqn/5pKIJAkcqiVSaijEKgxzK+0Q2WDCKBV5wRVHDc5r24eIS3vP5MHjkvDmdpnO9goPBWJF3eXqPMd76MS+u0FhEyg52pAxkHNvcqVEd4qmhD8x8ELMwLEuxAH7n/aTDct+zp4hRe80t47AJYXwzo1PubhFV+YK6ZK5x1tS0l+eXJvaOylOjQXN1EMEavzmLNQXhvZ2R1cosUfpOiZIVMbIhFcYKX+zxmkHR4/Aq/MHDsxbhbwWcfZp5twOQE9sdblPLU7cu09R17IAxAJatIz+8yP/9ESiBLNuo5kcGsxn5ZEF3WjjjkrFGUaWa6FeYTfNb2WLAxVOG21k07cUjsNb75N6vDD7hC7wJmidWVF7rySCeNFfjx0Tl/EaJybpyxoVDQeXdbMEGw7AM8tDrP4+JHk7eUWns+m4W4qk2FS1arqlMoCcANtHsdDpgQDQ66qhPXls0rkdei6RcAMyU8WY11buVWgfM3IFCDn2LiHqMrYrth2zjhTXyEUg9CkE00NZkAT/+YQLZw0nQkJMORTMQIcaGX1RxTBKZupAwL1WaAKfV4Cep70VBgvx1zsg0QIALSYOtu0BB/KhgSnKYu2DHFafxROEPj8tyazyGGaASlRJOiOzxuGSmSnzC9ApzW/40M2bsJ2Ovo3Ch+IrVSZrpI8aYpkrPbc2VnwEW+Ytt+2VME9rmuVpO1rUKA7sugh8vInIEb+9zFKb9Fw55r8oNLTpT+zrT0IKmP0zSl mhdCLcgL 7dk/DVggY1vwRXaaJ1R/PIjU26dcFyuA4xH+O3SViPTqXcNiKcE/+1RJcTqdX/H7jNwugfC56sVESwPa5gu39Dd1vtWmLrBMDIar+z3RGBBmVmrEIr7yjiMVEsnHXUgw3ADkXKa5Adm++LcS6C8VNohd2OydIyflNLMWhjyW/C9K0LHNxYM9fTTGpe99FZTSRnqOiU6hGKCzUhQN+Jb3HxsR/tq9BeudvOOeLPYkBJOqkJcNZGtnyN1FN0bThgJqrS3Q4wfBp0eM0GwI= 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: 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 6e76216ac74e..c278f8b15251 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) @@ -346,14 +353,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. * @@ -404,6 +403,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,