From patchwork Mon Aug 26 12:40:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13777863 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 7E964C5321D for ; Mon, 26 Aug 2024 12:46:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 604146B0271; Mon, 26 Aug 2024 08:46:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B3466B028D; Mon, 26 Aug 2024 08:46:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42CE96B02B3; Mon, 26 Aug 2024 08:46:27 -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 21FAF6B0271 for ; Mon, 26 Aug 2024 08:46:27 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DEF85A10F0 for ; Mon, 26 Aug 2024 12:46:26 +0000 (UTC) X-FDA: 82494369972.13.C663C23 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf07.hostedemail.com (Postfix) with ESMTP id C89644001D for ; Mon, 26 Aug 2024 12:46:24 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linyunsheng@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=1724676317; 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=XG0AMfntjar8R2wbYDjeRSL9npEsHL8uxsywldNm/NE=; b=wa/YAQ8aFWHt+Lh/CLCAbUnOy+NbbAcqLs6LD+zBsD7sAs256fbK5tfWTwGVGd8OlBZn4h RFNKgcApfcFRGAE8kt3qDrMFdBbOXrhl1OJRt62NR3sOtNF0KL9V6ndOvuD7CsXNRGPnMz iFuYsPQWGdHobXaDKlfRKcNDXdOcuF8= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724676317; a=rsa-sha256; cv=none; b=tYIeHJoB6uJGyu9mCXAQwVHDVV6cYOfVpPDwffgkbByMNFduTcHZ3iK2kq/7MGo5XMQ9UN vwCASE4ndsAeBngr9Ylqaf0nJmJZIvMKTb3shRuH9YWT4soFrDzviOT9RBhppspOul3VyS wbz1xB2LtBsSkdwRbHbJm21ozDnYWlI= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Wsr366t5rzfbC7; Mon, 26 Aug 2024 20:44:18 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id EAB501401F0; Mon, 26 Aug 2024 20:46:21 +0800 (CST) Received: from localhost.localdomain (10.90.30.45) by dggpemf200006.china.huawei.com (7.185.36.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 20:46:21 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Andrew Morton , Subject: [PATCH net-next v15 08/13] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Date: Mon, 26 Aug 2024 20:40:15 +0800 Message-ID: <20240826124021.2635705-9-linyunsheng@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240826124021.2635705-1-linyunsheng@huawei.com> References: <20240826124021.2635705-1-linyunsheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.30.45] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf200006.china.huawei.com (7.185.36.61) X-Stat-Signature: njyc3imiuyjowu53d64zjys8yark1k64 X-Rspam-User: X-Rspamd-Queue-Id: C89644001D X-Rspamd-Server: rspam02 X-HE-Tag: 1724676384-153658 X-HE-Meta: U2FsdGVkX18G3qAHbIuaVMzfXNF4f6zCrxuouTZb3uQ5DFrCnGKQ4R06SLghSrVHiGRjR1z85DO8pkSVBBculCJJ7MYBB9PESy77pmQi5TVK9Kky7FlZz/E1BxiLa+bVg/TSxdPjoJnbR40yFRLXS0h1JtLLK/gbH2ebK9dzEiJ8RyYaP+nzbicxO7LPPdUuQ6VNHVHME9OWQvLZW3gDHaEoEGE1f8nPrqQaXgb8ufdsteWsIMyo+6AWNrlLGle02k/0e8zFfma6oo5ENwjvgMUvkWh+xLhPSC0A97g+9hqhDUvCDMwjJjft//aByLQMTXMqrpPwz4L01oeztZx8dYfjFwLEbY0EMKoP6XvS8QhQh3ADOK+EuW7Tpus20zd7xt/mHOXYbkB0RGcplof4ON6zd3rAkbfiL/j366cAHDCWwTasBdaHZnhdtO9CBDE+68F5agvynHEwUrMIfltEFhRuuZM4UHxGCI1CjChdKfqaAuMU5aggBvytbjVXRM9Ye88dQPe2kd0ELw6XHZEMv+5tDJ9L7XWikihQgag3yMuVYUPDayywJihFmTIDqYyD3I0sg0ccHrnaObhA1LaDI1I45VuhcXUaeuJ4ouJ8v5Sxn7GDzPUGvqmnIA5c9OFTvS7qaTVWQyR27sZnDVmj1/H9keMEXva2Y9cXd7o1r8P+aJWD9ITiqzoJWLQtmj+LYsqZKuHt62cdMMwViBS5BdpQqprWyruPS2xPcfnf52JeYKt72ELfb5tVWqJf2WE9M2Y4ZCkiDX0IjjxWWFWqsE3J3uDi4ZcYXskSFoslBQFxBUxnQ07m1jfqDFp/CWRuJpccFm19N3mtQYcifBB4zHjI/Km4gO/GE5U8Yqd4lBLGj3Ojay/jfggAI702TSkVj4tBZO4rxyQZNfZLpq7KfaO/s6JTOfmPeFt4XToKEnr6/AmWrmX0FbxxkqGVWAz/fr7A6EcQz/EtH0JFFTn QcyTTVOr K9EOCEUR1f9HbuS3PtMZJzfu7micbpUahL6rk/YB2MPlNFoWgFbwtU9DSp34Frya2CQ+aT7dF7aUcbRw1tzMOoVV/Olk+Ks/PrDnqelP7NX1lZDIsf62NZrnW466yOWj5Bot4v3hGbZcOpX2IkKho/eLCiYNf7csOTigMzSjFhfNIXdrjbHwASJauGzJ7R2EM3lAInJy9d2ueyrBcB4XZBZ7KykrdpS66y2hyCCZNBs7ZTij0OaALbpE5ZpQ5VgN1NLNUE+CTia7l11/coi8SX/sKz9zPDzhhoU2E 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: List-Subscribe: List-Unsubscribe: It seems there is about 24Bytes binary size increase for __page_frag_cache_refill() after refactoring in arm64 system with 64K PAGE_SIZE. By doing the gdb disassembling, It seems we can have more than 100Bytes decrease for the binary size by using __alloc_pages() to replace alloc_pages_node(), as there seems to be some unnecessary checking for nid being NUMA_NO_NODE, especially when page_frag is part of the mm system. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- mm/page_frag_cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page_frag_cache.c b/mm/page_frag_cache.c index bba59c87d478..e0ad3de11249 100644 --- a/mm/page_frag_cache.c +++ b/mm/page_frag_cache.c @@ -28,11 +28,11 @@ static struct page *__page_frag_cache_refill(struct page_frag_cache *nc, #if (PAGE_SIZE < PAGE_FRAG_CACHE_MAX_SIZE) gfp_mask = (gfp_mask & ~__GFP_DIRECT_RECLAIM) | __GFP_COMP | __GFP_NOWARN | __GFP_NORETRY | __GFP_NOMEMALLOC; - page = alloc_pages_node(NUMA_NO_NODE, gfp_mask, - PAGE_FRAG_CACHE_MAX_ORDER); + page = __alloc_pages(gfp_mask, PAGE_FRAG_CACHE_MAX_ORDER, + numa_mem_id(), NULL); #endif if (unlikely(!page)) { - page = alloc_pages_node(NUMA_NO_NODE, gfp, 0); + page = __alloc_pages(gfp, 0, numa_mem_id(), NULL); if (unlikely(!page)) { nc->encoded_page = 0; return NULL;