From patchwork Mon Sep 2 12:03:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13787183 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 38798CA0ED3 for ; Mon, 2 Sep 2024 12:09:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF2CE8D00D0; Mon, 2 Sep 2024 08:09:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA19D8D0098; Mon, 2 Sep 2024 08:09:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97D8E8D00D0; Mon, 2 Sep 2024 08:09:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 721738D0098 for ; Mon, 2 Sep 2024 08:09:26 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2AD5AAB1D1 for ; Mon, 2 Sep 2024 12:09:26 +0000 (UTC) X-FDA: 82519678332.04.E931D04 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf26.hostedemail.com (Postfix) with ESMTP id F2BDD140008 for ; Mon, 2 Sep 2024 12:09:23 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.255 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=1725278941; 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=WSI5SpDRn0JwnmHTHK8AZqrxg0yYt8nYHzWMmXyWPrzbU10bWXnmMz7yK94H+wP1HogT56 4ttwVkT29AJpEKarnLUoxvHuZoyYIckRI1tNR8Douusntgrhz1XKlaxDEPKnLYQpgZEXtr xnN3+k8sYHj2URF0X99jUqn1nosP7Rw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.255 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=1725278941; a=rsa-sha256; cv=none; b=WKmCsn2nZBrnnOCNiCQgr31NsHb8pcrTKH/ph41cMDuCd86YW3TVyNkHI9wyyECmkiFdPC B0O14WF2JR4LjpXHqu9SK2NE+3DOG74TUyEhcRS6nZgKCfz1rolzJ722rvQJrPoXfv+QXy L7qth7WnbOg40170MJgT9zExCIJuSMU= Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Wy6wT4GF1z18Mmp; Mon, 2 Sep 2024 20:08:25 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id 6E2131800FE; Mon, 2 Sep 2024 20:09:20 +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, 2 Sep 2024 20:09:20 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Andrew Morton , Subject: [PATCH net-next v17 08/14] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Date: Mon, 2 Sep 2024 20:03:07 +0800 Message-ID: <20240902120314.508180-9-linyunsheng@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240902120314.508180-1-linyunsheng@huawei.com> References: <20240902120314.508180-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-Rspam-User: X-Stat-Signature: 19usci5pwricj1m3jonxkwbjbkxg3w91 X-Rspamd-Queue-Id: F2BDD140008 X-Rspamd-Server: rspam11 X-HE-Tag: 1725278963-234343 X-HE-Meta: U2FsdGVkX1+/uPbwVgHrziQlHSLa+KvVuD0Bu/t2rK6s4zBl91OKyS1uadyxm6jc5KxZUW49LubfrqUMq9wKk4/abuuhT7psVC6Ey6McqMRg736lk+QBGHSWLvns/nTWRul+bgiYCHTQ6W7kakv7Rhrajxj7+3RGkJp/uUDrf47nKM9Cbfd8mjpJWBICLRQ+WNDc5Ib3sA6POq5ziJ8WVfLz9/02qwgQzCyWFEqHq4eqTxR2rUjelleJ0yvRM6JtK+7OvdslQbkDbeRBv1w9D1Kt7VYAPnDkj+8C2wpvXmBb5e4AiOSslWkf1B5ExyaOd9QO5N2vdZkpEtW0VCOW0TigzKtfMj5zZAjJBDJ9tEQ4r1LJkv/NSjsssHCvqvW5X3v8JH/kqgLs0JHU7WJmdCsnoS/HPIEn/imcOXsR/ghQRxsnUvwoYlanVGttq38n82m6EQdqKvTvOYGreh9arDF+PTtrLzxd7mMJ75kLzcb86Vg9INWCJE9w/nxsE1Wyd+K4T6SMaSREw1pqzV5MvZcduHccPcjhlXxUPqNI+dz5dcJ1v61AZqJYHSz1we8m9GHloiL49c3ZgyrKx0uM34lc6GUe7G+7wqsWcJvQ5ZHDwrfPIWL52eIDchTj/2GrUXrIBlqzM1DH4TA/jJFG8gJJ3JPpz2wJYOL5wMESnCiVL3t1OeskQF6h3/E2L7AJeAbc7AY8y4uqjvkQvlt4HCcTtGvNwEBpjN7VZITf4xnA/PHIbPtJ5uenIwLXO+1ktJo6OSlZf9xtcSKjGUhedyiyowM7fV3laLgC88P5UaNeBY1ZizPgdaZGdah0HTeTQ0kJeyViLF5MhVweRqCkMbQPnqclb9inLLUCB7EhFhFg2e5Wp4Ihj48xMUCsXL5bobtyTUH3WhRDMjH8MZnoglbzzdZU8bzUX8zCQ5noDLMF3I1nRszGPBWQwvfclsq940ykriS4NhGrFpd7aF5 +I19OLOX L/Wyc0V5jJx3gPp3CrWzWfVA6QKkTMf3RMDE/sDZwRSCPTt5ufkVBtPhnQGVou/PA3VcR381f5NyBm6cMHG/ChkOkofLeEnoFavE+RM4yecaDysouf6kgolBX7d0Da5ASAPh/o0zpLjwVNqXXUNW2nUmi959zcrhJFC1HDH/Gaw+VRS5ArUhuAOoyc61aF91wawsbiyb307x8901gsqIrKLUMaPa3zsymv3G+L1cgahQppuuW7lO0N719nObWT8JOA/uOYDaZe4eRTZsCdpAsDWZpgTSXTGHFIrn3 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;