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 88B1AEB64D7 for ; Mon, 19 Jun 2023 01:34:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B31E18D0002; Sun, 18 Jun 2023 21:34:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE20C8D0001; Sun, 18 Jun 2023 21:34:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D0718D0002; Sun, 18 Jun 2023 21:34:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8E7F98D0001 for ; Sun, 18 Jun 2023 21:34:37 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 498F5803A7 for ; Mon, 19 Jun 2023 01:34:37 +0000 (UTC) X-FDA: 80917777794.18.618770B Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf13.hostedemail.com (Postfix) with ESMTP id DE9CD20015 for ; Mon, 19 Jun 2023 01:34:34 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687138475; 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; bh=CxDGCS+OyeS7/3YKQTk9sAMCxQsiDOTaL7/zsbS4R2M=; b=4tqwk0P/4gITnK5oPR8zKLjmH0lfsWYQLfIiuug9TiiMpAt1zGNA9nP4EMzMOI8wSaB2SF ItN+cYc72jkPuEUPsqiW1O/C4xskGGgKDgubMMi0BhmWV7Sy9Ocovar+IseGPR2jaZXRRX F67jEnHELYQ5R+WwHll/hcR5HchAl9U= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687138475; a=rsa-sha256; cv=none; b=Tu17GrSyggfGr+xxpKSdIRjXUO6UsMef5aK/UEB9tauv1yeLfirE8llkHkrKkQeB31AUyF Plx/pP7uQyev+Ky9GkgBwAGW3iNis9fz1FdetqcOAudnmaNceBCVoo6+kSUqFW3349G/D1 7Du9SShmqoLbcTNHZ0ZSgQnNi2JTCFM= Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Qksjs0JnKzTlWv; Mon, 19 Jun 2023 09:33:53 +0800 (CST) Received: from [10.174.151.185] (10.174.151.185) 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.2507.27; Mon, 19 Jun 2023 09:34:30 +0800 Subject: Re: [PATCH] mm/mm_init.c: remove obsolete macro HASH_SMALL To: Mike Rapoport CC: , , , , , , , , References: <20230617070955.1751393-1-linmiaohe@huawei.com> <20230617075644.GV52412@kernel.org> <6d149902-a944-7961-89c1-f07047953c7f@huawei.com> <20230617105137.GX52412@kernel.org> From: Miaohe Lin Message-ID: Date: Mon, 19 Jun 2023 09:34:30 +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: <20230617105137.GX52412@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: DE9CD20015 X-Stat-Signature: yu3e3s1gm57sk6rw788uxw4n47pkiish X-Rspam-User: X-HE-Tag: 1687138474-646434 X-HE-Meta: U2FsdGVkX1+eSUF2H4ag1tLthoP49F5CmUsF28F1YipLA+Rbssl8pB8kfjReAtRoHAKT2pfXpFy5o0SmZqWQnPPYdq55iQH8HkD1Ug2UxUD4pIOeN9fzm86v1jDyQA0MpCXpzJn1BkQ+rjedJ17NNxChwrQIz4QCH/Z1myF3V+G1wkM7XHMXqF0cMh5i5J9KT/9q2ntIPTOYFpbZ9ckPQDM1u9bErWAYY190LYxx48fuXGwTuCNmUZSgNQqPXyRyfwfmCgofi4NZrgJgljPv/kcnldzBqjPc790KLegrb0sL0g8na2IEAQHO8LIU+GAWyq5uDNwtsIeR0Jk5Va7Wfbnod7apo4dMAEmaysqHVUb4GyAg99Eb/LVU/QrK0d/QECIhuDgnHoXT28ZwDpcm2rOkstsMe8nkx3sAkn0FbJmUYX2wNPOoGgR8FQj4nYXuqA0Yoc6+luD/9sr9ykA6VQN4/n6ovT8oh5PrKZmeHtJK6PoAPBrlJbNl2jQZjmIHmMn7PQJ54Rtptwpswyuwrw69J/fDg0Lp7IlzegLqHgXk/bjnzurROoCTcsMYjUn3mGn6KycuIyOGW1rEYBf2+FXh1aYRNTxo82MtTVLnTPrYXrZk2EYwnojYQuX0JMvGeAFN9Rj++ilpvdCx0Cn5iyTmI79Ver4gL7x9zOiQiL+cn4+Ukxp7ilI7ePw2scMJMyqMJmuJAkLfSnuQGiYh1zsgSgE+4kmvgGvzI26ugEIvMkVCI87iQKIPS0OdlSCz2zs3DNpJ7PyL9INlSX6NisKriwUGCgUB0qoSu9XFFQ+KPvHQOTWqQrEv9vv9yd3KL2LacwW75CuKbOYeRRJcx8TTHooyfVI7Mo+cvk5+vIT4K40u/LQbSu09M8PpnMv30pOnl5jn3r0NhKz5bFRuloz1XoU/PHa3RJi3i1nwM7GgAZUDOSXNVwzp1zjpusDMzbQv3X5UC0hqQt0IgdX tG+Qkw+z gBcOzyn0GpawsnUpZxYdaHrpMZgvCOdu0SmEtdA+1w/Z5n8/DtnZAIKBdQ7kWlDPgT4lOQROat+G/D64Ml8SQSpm7A/I02F2Qa8qAcKVOFk3FYtpUslJ2GoEqnROUclJ/jpuZQ4pmGLauKTVnb61kGZ70CDOc7zaErylHlsNyt4t3Foy2NmPZ7fpSj2oF0+kDzVUGeVBZZu6xhhk= 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 2023/6/17 18:51, Mike Rapoport wrote: > On Sat, Jun 17, 2023 at 04:39:44PM +0800, Miaohe Lin wrote: >> On 2023/6/17 15:56, Mike Rapoport wrote: >>> On Sat, Jun 17, 2023 at 03:09:55PM +0800, Miaohe Lin wrote: >>>> HASH_SMALL only works when parameter numentries is 0. But the sole caller >>>> futex_init() never calls alloc_large_system_hash() with numentries set to >>>> 0. >>> >> >> Thanks for your quick review. >> >>> Doesn't it? >>> What happens when CONFIG_BASE_SMALL is set? >> >> When CONFIG_BASE_SMALL is set, futex_hashsize is set to 16 and alloc_large_system_hash() is called with >> numentries == 16 && flags == HASH_SMALL. But in the alloc_large_system_hash(), we have the below logic: >> >> alloc_large_system_hash() >> { >> if (!numentries) { /* numentries == 16 here, so this code block is skipped. */ >> ... >> if (unlikely(flags & HASH_SMALL)) { /* So as here. */ >> ... >> } >> ... >> } >> >> So HASH_SMALL is just unused. Or am I miss something? > > You are right, I've missed that. > >> Thanks. >> >>> >>>> So HASH_SMALL is obsolete and remove it. >>> >>>> Signed-off-by: Miaohe Lin >>>> --- >>>> include/linux/memblock.h | 2 -- >>>> kernel/futex/core.c | 3 +-- >>>> mm/mm_init.c | 10 +--------- >>>> 3 files changed, 2 insertions(+), 13 deletions(-) >>>> >>>> diff --git a/include/linux/memblock.h b/include/linux/memblock.h >>>> index f71ff9f0ec81..346d80809517 100644 >>>> --- a/include/linux/memblock.h >>>> +++ b/include/linux/memblock.h >>>> @@ -581,8 +581,6 @@ extern void *alloc_large_system_hash(const char *tablename, >>>> unsigned long high_limit); >>>> >>>> #define HASH_EARLY 0x00000001 /* Allocating during early boot? */ >>>> -#define HASH_SMALL 0x00000002 /* sub-page allocation allowed, min >>>> - * shift passed via *_hash_shift */ >>>> #define HASH_ZERO 0x00000004 /* Zero allocated hash table */ > > Can you update HASH_ZERO to 0x2? Will do. Thanks.