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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54972C433F5 for ; Wed, 6 Apr 2022 14:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234624AbiDFOT4 (ORCPT ); Wed, 6 Apr 2022 10:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235620AbiDFOS5 (ORCPT ); Wed, 6 Apr 2022 10:18:57 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E08341A3945 for ; Tue, 5 Apr 2022 19:38:05 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KY7tX03bwzgYLw; Wed, 6 Apr 2022 10:36:20 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 6 Apr 2022 10:38:03 +0800 Subject: Re: [PATCH] mm/slab: remove some unused functions To: Vlastimil Babka CC: , , , , , , , References: <20220322091421.25285-1-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: <3fc79634-da36-88c5-0e5d-10be704f9fb5@huawei.com> Date: Wed, 6 Apr 2022 10:38:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/4/4 20:49, Vlastimil Babka wrote: > 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: Many thanks for doing this. :) > > 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. > * > > . >