From patchwork Mon Nov 20 18:34:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13461883 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 200F5C5AD4C for ; Mon, 20 Nov 2023 18:35:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E12FD6B03EC; Mon, 20 Nov 2023 13:34:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D19246B03AC; Mon, 20 Nov 2023 13:34:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD2B56B03E0; Mon, 20 Nov 2023 13:34:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8EF0E6B03AC for ; Mon, 20 Nov 2023 13:34:47 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 6BACF1A0419 for ; Mon, 20 Nov 2023 18:34:47 +0000 (UTC) X-FDA: 81479183814.07.B3B6F5D Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf19.hostedemail.com (Postfix) with ESMTP id 549F71A000A for ; Mon, 20 Nov 2023 18:34:45 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=dMBs6gEI; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=dYagauic; dmarc=none; spf=pass (imf19.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=1700505285; a=rsa-sha256; cv=none; b=vbL2Hn286HBEKfbf7oC3jyMVGaXnyjBqGOYWZWcdLA92zrc3jOXHy3FUX1NU5FzzqvvW0F WBN112I1dYeai4g9jNbs14rPHCBEHrkeH2LH2MUFzIv0oQdT6TMLfPXQxrpg9T+uyPUfEH 8ShW+yk80DxEdiZ2f16+1BitlRpLoOk= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=dMBs6gEI; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=dYagauic; dmarc=none; spf=pass (imf19.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=1700505285; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4OA8hmbuH8MxWfLH+c2HkYn0Z7Eu4RuF14fgas75tZs=; b=UhiWpyyT0z8PPmVfKhPNpHOXoaXLMhaZ4ORGseP+jYzNeTwPXZpoujVUAXpD3+XdamAPYZ VVJXE8eQ+DzzJH0ONeqIPOQYOmWJnRw0wZjwpUSRc1GlDw0od5i5sjkKcXOwOL1OmD2rcH qDwRIppH3tG4NbvLgZerPBIHRlKG6lw= 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 453B31F8AF; Mon, 20 Nov 2023 18:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1700505282; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4OA8hmbuH8MxWfLH+c2HkYn0Z7Eu4RuF14fgas75tZs=; b=dMBs6gEI5Ex4jL6H129zRPTwlSNnJ1qC8oVF5wBujjyOkDMCeCG9OYEJj8x8abL8uJN/1j 3ZsKxuxyBTo1FBvzQTZKbSx6bfKtSEqolZGVksbl+7ENXSk2UXedzeobvBoh1iaHgfDyD7 H4UhCy8bCZZNTZB0BsOg/4oBmwpstnA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1700505282; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4OA8hmbuH8MxWfLH+c2HkYn0Z7Eu4RuF14fgas75tZs=; b=dYagauickYxH+NAtnsoubj/I4t2hRXY+jEoJ04i+dfBEY9kZnPN+7H+HkIhfKp/ZC2orGs EYCkAZqEh2MwR6CA== 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 166FF13499; Mon, 20 Nov 2023 18:34:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iLgFBcKmW2UUMgAAMHmgww (envelope-from ); Mon, 20 Nov 2023 18:34:42 +0000 From: Vlastimil Babka Date: Mon, 20 Nov 2023 19:34:23 +0100 Subject: [PATCH v2 12/21] mm/slab: consolidate includes in the internal mm/slab.h MIME-Version: 1.0 Message-Id: <20231120-slab-remove-slab-v2-12-9c9c70177183@suse.cz> References: <20231120-slab-remove-slab-v2-0-9c9c70177183@suse.cz> In-Reply-To: <20231120-slab-remove-slab-v2-0-9c9c70177183@suse.cz> To: David Rientjes , Christoph Lameter , Pekka Enberg , Joonsoo Kim Cc: Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com>, 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, Vlastimil Babka X-Mailer: b4 0.12.4 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 549F71A000A X-Stat-Signature: f8pjkuqin979xfoixbjx3q88w6pmaps6 X-HE-Tag: 1700505285-173957 X-HE-Meta: U2FsdGVkX19QnKfKGkrXYaI/y9rZGUYt2SKdxzGSdeUV0jW/hnYfeB5FVOCVoQNR43Qrf8o7031LLJ1bKFVoT6ueezVcsePMHkdc4RQAyKAnAl9U3AF64pJIiDQzltJpvS7O1RX1KcgOHD/ktY79xSQQ5zJcvuUjTPX3NQPdoyR4TdsjFIzxYPQEyjg3NjsVmAN21zMgSGmfSBfcCoVcQc8MP0Y1bd3KTcWhEcOvnjBczATEyM+x6Zx5/OxPOYZSMtFnE5k8V/OidGJsXhaeAh6b9BuJ5laNraIgJa4w2x8dAwZQsQ1XyNKU72rg1EPMnmMID8nmeJqt/aD0aF1g5hHiZn93wAOO0oiJDiJHfhCXaItK22meDEo1OwxogqBiwdQKn9KKYVhYb7pL8Cs/YADIifwmk4ehvYMiKMvSQJRsTVMSIihG1kuvIJ6Rd1akM2IJcfK5YYxkOG4RktqNGmC9NGl8TgdOcKwFrzad56uK4qEk27TSIIJThAsKxriOtxMn+gytzlFrrDYxaZp5f8X2D77rdlpKPcDHqqy2z/xyboX4/wEwxUKIhkjBtUBpZ9Gho0k6YOqb0FmJMcXazGzTjoRP1IJ68+sN1UVzdje3hnlPiBZOBPChBA6u8T8QU/H3wIbwI/JKtiP40KKACP6ofEgK/0WbAECKT0PnLD4ykgHtUcev/6I2JkyMchjNnE9B5d38SzH5YeLLb8cg0dDwnnrPqzDKssYoJKm4BnZVwBWDNu9H0O/xmS0J1ZJNoohbSvky5NiBHiWN7eaHh3ukn/a6WrkR4BOl+cn8f75PR8lasJP/pctEjG34dpNz203cQcPa8f8h70Sox/mHeu1JKvDgMP4LietJpzbTH2L0/TCKbSbivdGoO1I9kPCmgIBkIuY5mpjVI0NiYvZYjE3ZYut/m4m/THa4PyG96kinKJXa1c4RE6x6aVc8IbWX4+LuTlodidmMX1NH/sw HXBhpjZE LirQgKuJj5i6WPqzPgkrG0Ofkq+nFsN3vHiWEO9iVaq3scqki8QLTcfWz5FTOewiRV4kW4IU4LdxwRhr+GnWuDWvOy54SYtcih3ArHbHJ4fj3uwoJIxJMaanbU0QtkljmKPV6tB9R8EFeLq9gigft3rbHIKTrW4HLTB50/juieRKa3KduDhmSQdEVFIj7qIBtvkjLrp5knJQ/dR2/HLWM5yVYA5R63q4tqWHDYO+g4zRilGpOkpew708ImlULP9lHVUhXWiWTVQa+JX/o9EtksnuOpA== 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 Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> --- 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,