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 F033CC433EF for ; Wed, 6 Apr 2022 02:38:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6931C6B0072; Tue, 5 Apr 2022 22:38:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 642F96B0073; Tue, 5 Apr 2022 22:38:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50ADB6B0074; Tue, 5 Apr 2022 22:38:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 41B456B0072 for ; Tue, 5 Apr 2022 22:38:18 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 0E6EC1201AA for ; Wed, 6 Apr 2022 02:38:08 +0000 (UTC) X-FDA: 79324894656.12.41C4E05 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf13.hostedemail.com (Postfix) with ESMTP id E04B42002C for ; Wed, 6 Apr 2022 02:38:06 +0000 (UTC) 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 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E04B42002C X-Stat-Signature: 4npd7p71d6y3q137tzbua7ass6bqsusp X-HE-Tag: 1649212686-164928 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 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. > * > > . >