From patchwork Sat Jun 17 07:09:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13283470 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 E067BEB64D9 for ; Sat, 17 Jun 2023 07:10:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FF266B007E; Sat, 17 Jun 2023 03:10:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B1316B0080; Sat, 17 Jun 2023 03:10:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C5AD8E0001; Sat, 17 Jun 2023 03:10:33 -0400 (EDT) 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 4E18F6B007E for ; Sat, 17 Jun 2023 03:10:33 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2307C160EB6 for ; Sat, 17 Jun 2023 07:10:33 +0000 (UTC) X-FDA: 80911366746.24.91A9865 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf10.hostedemail.com (Postfix) with ESMTP id A685CC000C for ; Sat, 17 Jun 2023 07:10:29 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686985831; 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: references; bh=dNT+H/qVYP5V/hUdTGN9CPXuCR5FZq8kqaosGz5dRV4=; b=nVhuvOhbuMSWK5iLS+znooeirK++NEjnJFV5osNKxanUj+OhL4FZxZzPUULc9+vV8K2aUn fb721m5zTVBabhW9JjaogHF9OiyAYKo4TKR5IkT5xmDXDA94ewERwdNiSrsnn9P9U5qhQc 2oV/SlbMXCf4yDK82VdmIu41FKWZS+U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686985831; a=rsa-sha256; cv=none; b=6LClWiiPplMWwrplx8DQy0nYVNnWzsqlJR3EhA2r0UUWprmNwFoNim3mu/eAAPYuY6cTkV c+xNxqQajRM6p9/zvbAWUJcjhoT1+oGKJkIrkv3TGTj36pvqr3uIvt/tdMlB7WKa/U+1GA sCNJnYZ/KlDDwPlYD7z37mMXAOUko3g= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QjnD73DZ4ztQVr; Sat, 17 Jun 2023 15:07:51 +0800 (CST) Received: from huawei.com (10.175.104.170) 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.23; Sat, 17 Jun 2023 15:10:23 +0800 From: Miaohe Lin To: , , , CC: , , , , , , Subject: [PATCH] mm/mm_init.c: remove obsolete macro HASH_SMALL Date: Sat, 17 Jun 2023 15:09:55 +0800 Message-ID: <20230617070955.1751393-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] 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-Rspamd-Queue-Id: A685CC000C X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 695qe5c9prdttn7kqankstme8xis7yrf X-HE-Tag: 1686985829-211252 X-HE-Meta: U2FsdGVkX1/ohuUtKyw3xOAjwTKhSysqkheGlLrvKav/IHyZD9zFFhih5hoBq7+i+uRSocNMGay3BX7NMULvge2lwqKr86IxrVFlc9CK3btx/N7DK+Dg6ubiVhGxE9WRadLTqoHVerZ0qx6RuLtJQNrKp8pMDvMORJndNPuMIOB4UfEenpzpBjo0SylvPfB8+5rZOetXECw3Ddn7TENPSLr3GPaez6EZFZoujAUlw9DPFkvhyo3WEUFCNamGTkv0xXGn2At36dUcrJNIOVJgaislZsqyMZcp/N1cmy7pUvDk1urkJ1T7wqUFSMy7jr54AaveDU7hrul4KxXcZZU6WH04+xsElhZxWluXXHSGiOvSMMKqlNZRsKH2dIsAYNDagHHGO2nkswnq3GBwSYY6NQmDOY8zM/8AAZD5onUNnodUU1lguAgnGLmUn+MI8dN1CLHYu32HIeQlilWDhx9ODdFm9+Hyqz1JxgHstAz6/r7Vht6r+lPuD0tzASOMSLcUEqKhbFdKYgoAuoJYOmZb/i/1WLmmFSFIH4KFwKSvWjCEf/70+3a6A1yikoa+qaQ7d3J+iVdJziZ4QKKddKPfRLUj0ahBo77duXiVR261ZFZUFOgmOUsJddP9EUBpdKRCYxSb9VSbcUh5qTgK1ksWKxSmRs/6DZC5y8EtDzG1gKcqWXfqqFB3XdRYN5P/2G75QXAwkUWo73VfbdHjpmOou7ytHvIj172a1HrLXGIboVjOMsKEp/mMugERRJFG3I3KiUVRfw8s1DtuJqtvYTgsLFVpLx5QH0TDKIEtOBv1Muu97bE9NOh82GHB6uUYKd6Tg6k3oLxeZ+p1YVwA82cggBrdsWPBvfrHJuccZXiVn78qRaXMkfTBfLg/2O6yDMgBpDnUdRkItvNT+xrrUJoBui8Pew71P00b+clWDW2RMIMWFQcmXbO27407Ox+MwgdjZTMANnzH7Vx6+FO7aT8 mdnKh7HE 7gTPDNG/eI3T5EOWSA+PMKOQHAg7n3IjXW8HGG9QJfyO7yGP0zQvKbMZJSvWdck+UDNcfaD3rzx0N0YMo8BAHT1TOq5FNi54Pz6xpX3QNrA1Hi+MKucwIem8Cgx2qyRybS0tu9lwmqeXhvlaIYrCy/EuQJthppyVeCBenchKHtE54K/+EfirTzgeKlmZWXJ9rTpG4 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: 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. 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 */ /* Only NUMA needs hash distribution. 64bit NUMA architectures have diff --git a/kernel/futex/core.c b/kernel/futex/core.c index 514e4582b863..f10587d1d481 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -1132,8 +1132,7 @@ static int __init futex_init(void) #endif futex_queues = alloc_large_system_hash("futex", sizeof(*futex_queues), - futex_hashsize, 0, - futex_hashsize < 256 ? HASH_SMALL : 0, + futex_hashsize, 0, 0, &futex_shift, NULL, futex_hashsize, futex_hashsize); futex_hashsize = 1UL << futex_shift; diff --git a/mm/mm_init.c b/mm/mm_init.c index d393631599a7..fab3c4649d5b 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2492,15 +2492,7 @@ void *__init alloc_large_system_hash(const char *tablename, else numentries <<= (PAGE_SHIFT - scale); - /* Make sure we've got at least a 0-order allocation.. */ - if (unlikely(flags & HASH_SMALL)) { - /* Makes no sense without HASH_EARLY */ - WARN_ON(!(flags & HASH_EARLY)); - if (!(numentries >> *_hash_shift)) { - numentries = 1UL << *_hash_shift; - BUG_ON(!numentries); - } - } else if (unlikely((numentries * bucketsize) < PAGE_SIZE)) + if (unlikely((numentries * bucketsize) < PAGE_SIZE)) numentries = PAGE_SIZE / bucketsize; } numentries = roundup_pow_of_two(numentries);