From patchwork Fri Aug 30 11:18:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13784987 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 C33ECCA0FE0 for ; Fri, 30 Aug 2024 11:25:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E1CD6B0119; Fri, 30 Aug 2024 07:24:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7913B6B011A; Fri, 30 Aug 2024 07:24:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 658DE6B011B; Fri, 30 Aug 2024 07:24:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 409936B0119 for ; Fri, 30 Aug 2024 07:24:59 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id F0ED5A170C for ; Fri, 30 Aug 2024 11:24:58 +0000 (UTC) X-FDA: 82508679876.17.67F8145 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf19.hostedemail.com (Postfix) with ESMTP id D19091A001B for ; Fri, 30 Aug 2024 11:24:55 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725017029; a=rsa-sha256; cv=none; b=aPvDr6QfATiwVYpl4+6bC7FxYxttI5dIGxbCs/NEjPukdb+2QAMVFFMQidOPIPxZo2T7B5 scS24XyITntQP/t75wFpEZxJ8jEKs2oKrifuziiWPgpJuD2dYHcTBk28STvvqj6ukvdv6P OzgfMr3eCsSbRVtzgjtt/96kl78Evbo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725017029; 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=CDet5QsG0tzjksLvwf1qxRJfVDUyEDL2+uSpA5j8caA=; b=v6fuuBwSqKC3I9xB1bSgzM4XYk9AyqIUISrWVQdEGpDMz2DWM8lbqNVmL2UO0LxPqP/YK2 Shx5LzeHLlRGHJWIzbn8MTBBroZpOYewOs30/XjApsEbCC1SSqAXz6s7NmdRTna5vTVcoJ a4wSbQKyNGR6njSXpeyV9NF4wSjHJEY= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4WwFzz73HQzQr5M; Fri, 30 Aug 2024 19:19:59 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id 09009140258; Fri, 30 Aug 2024 19:24:52 +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; Fri, 30 Aug 2024 19:24:51 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Andrew Morton , Subject: [PATCH net-next v16 08/14] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Date: Fri, 30 Aug 2024 19:18:38 +0800 Message-ID: <20240830111845.1593542-9-linyunsheng@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240830111845.1593542-1-linyunsheng@huawei.com> References: <20240830111845.1593542-1-linyunsheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.30.45] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf200006.china.huawei.com (7.185.36.61) X-Rspamd-Queue-Id: D19091A001B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 8igakz6p8o81z3bkiuk6drrxms7tixw6 X-HE-Tag: 1725017095-577638 X-HE-Meta: U2FsdGVkX1/nhr2bMsB3j72sZ+JWw+uW9bGE8/FxgRkvPVNA1m7+3+eR0c2d7/AvvyCuRNHPi5gSybe++Kf10brzUVq3AKfxTg7TuXcpE9qPN0AMJFuwYQJ+U4sNiDPZH7sIkStpFVWPbk5b/gUgVGFb47YJzg4cxX6nDleyxEIMiH/5FEcOa3WtlPEwjAAiBez/bXLw8oipDgghpNsMbrKVVE+KFRhqT1QWtlBz+0VGYcKPPXjjcRhcJBr8+YLI4vDHLeyqgj/BBtNHHyBywCbDZJqbnBII7KLXrIvgyHL2Hnn2lGIk4IsmJ3AVVhr3qouFB1dl3UitnRuTvC6mgf9nT3TESSgQqTO9OaGePwwat6LM40Eq3l2Z6O4e5o6jiuT4j3d9tZD3K1dHf81LZ0r2LmVUMB04WKJeWKqtfL1GTbEXbGbPXRYOo622EiLcgDx67VsEUmxMpr5LixYpZLZR7BSIvdmMlWOcGF5jbyVjm8F3/HCFeMPHteaigYed7W3MWcJ3pgSRDmGweq+cEozYwI2vj6tL0G2CU4XeWtezmYf66zzuOzLSB3pMigSn9HVfoKJ+8CvYdFfoF8LFjmB987lIJ2MRsXGBn/vzIhorrFag+y5tzyctwRJkb/bAvAMvEpeHpFMjuQH92NkGmsrYlkS4XoD+wARxe2pj0KoTJahYy3Ky3vAqd9Dt0hPbBvah6714NUzYqxRmV9uBXieQUgln9mRaKCat2qEPGa5Oh42bfSEJAPOGA1eAwZYpWQqC9EfDY6vv/isTi3pFkrRiExuaRomeBMXMiWeIvvh1f00FOfPCVJE0kTxFNrq8HZswnl4c5kNg72eNpO8q+FhJkUgsagDNFFQZjVYAWbnPf0s8S/zyuNArO9uSZO/SkrYwGmN0c8xfiXo1pDLDCvEqaTr/UL9AsmRZAeNZq7nC1CVOl74+dZRSK+oW62ytthaq4uexCZtswe+3T/E lACORhXG wKy9OqXyaBQRKD/ECw3JPCV0wS/oux79SJmwHgEzi3CxIetkgHVE+4TDt7xdQTXrWqH1ggOFaWveI99y9jYWFLGu8OIEfLvqyOlnmnXocB0VLrVZXBGEa4DYJHqg7uDOCVX9ePU5f7WFn1Ij50f0ewNhXZ67dllpZeca2IPv2i2T4c7bCs5d/og0gLxTRyvEGT+aZcbqYsZogthMVTbf9kaK15Ev0R82bxFlEPR8lI1HudRRopHjsjXYKylIViweOaZDDjwv4+IZzPAFiCyhztxt7eCl5kvjekiU3 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 62d8cf33f27a..994b85e7df67 100644 --- a/mm/page_frag_cache.c +++ b/mm/page_frag_cache.c @@ -40,11 +40,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;