From mboxrd@z Thu Jan 1 00:00:00 1970 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 255F1C433EF for ; Mon, 4 Apr 2022 12:50:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7148C6B0072; Mon, 4 Apr 2022 08:50:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C4488D0001; Mon, 4 Apr 2022 08:50:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 565146B0074; Mon, 4 Apr 2022 08:50:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 4877E6B0072 for ; Mon, 4 Apr 2022 08:50:03 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 11C9721A17 for ; Mon, 4 Apr 2022 12:49:53 +0000 (UTC) X-FDA: 79319178708.04.4A82FBD Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf13.hostedemail.com (Postfix) with ESMTP id 5A6532001B for ; Mon, 4 Apr 2022 12:49:52 +0000 (UTC) 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-out1.suse.de (Postfix) with ESMTPS id DE93C210E4; Mon, 4 Apr 2022 12:49:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1649076590; 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=NX9TgjUsjoTpfBV0l77n3hZgxLhDy2L3l64wvrgqdzk=; b=1M0dkIKc+oNToF53hUGZQiBQCY99ZI8/5n7ExjBxGqJ3LJASqhwZlWyrKB53WTkJnrOHvc /eim40GPO4CakLmStoBpgLgMgpGl5ZUrIWKIB1w4Xh4pgwu6DDYmbbF7ep071LaW5IlvqC pJ2ZFF6ueocIRij1c5USLGtNGH0robQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1649076590; 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=NX9TgjUsjoTpfBV0l77n3hZgxLhDy2L3l64wvrgqdzk=; b=wc+tMgWH0RYQsm+rnP7rhFVHRyjdYNz5grGHR0JjVysktRtZue+qviC0ieeiUPRr+fY3g3 ghrS5owmAk3VC4DA== 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 AF0E012FC5; Mon, 4 Apr 2022 12:49:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OEQ7KW7pSmI0DAAAMHmgww (envelope-from ); Mon, 04 Apr 2022 12:49:50 +0000 Message-ID: Date: Mon, 4 Apr 2022 14:49:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] mm/slab: remove some unused functions Content-Language: en-US To: Miaohe Lin , cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org Cc: roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220322091421.25285-1-linmiaohe@huawei.com> From: Vlastimil Babka In-Reply-To: <20220322091421.25285-1-linmiaohe@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=1M0dkIKc; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=wc+tMgWH; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 5A6532001B X-Stat-Signature: 896zjm5gug8j69y96n5sqczswhd74g9x X-HE-Tag: 1649076592-26586 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: On 3/22/22 10:14, Miaohe Lin wrote: > alternate_node_alloc and ____cache_alloc_node are always called when > CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also > forward declaration for alternate_node_alloc is unnecessary. Remove > it too. > > Signed-off-by: Miaohe Lin > --- Adding to the slab tree, thanks. Included also this move of declaration closer to its users: diff --git a/mm/slab.c b/mm/slab.c index 4ea12ddaa7db..90b16c7ae01a 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -626,8 +626,6 @@ static inline gfp_t gfp_exact_node(gfp_t flags) #else /* CONFIG_NUMA */ -static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int); - static struct alien_cache *__alloc_alien_cache(int node, int entries, int batch, gfp_t gfp) { @@ -3043,6 +3041,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags) } #ifdef CONFIG_NUMA +static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int); + /* * Try allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set. *