From patchwork Fri Sep 6 07:36:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13793533 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 D65FBCE7AB8 for ; Fri, 6 Sep 2024 07:43:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 770996B0098; Fri, 6 Sep 2024 03:43:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6FA4E6B0099; Fri, 6 Sep 2024 03:43:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 524196B009A; Fri, 6 Sep 2024 03:43:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 298306B0098 for ; Fri, 6 Sep 2024 03:43:01 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C9B5A41020 for ; Fri, 6 Sep 2024 07:43:00 +0000 (UTC) X-FDA: 82533522120.30.0DADF58 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf14.hostedemail.com (Postfix) with ESMTP id A13AA100013 for ; Fri, 6 Sep 2024 07:42:58 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.190 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=1725608480; 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=sR9vRYEcXuBQgfnyXyRtsK0T+JgIrK+AMvd6vS9TV5A=; b=iX0lnr8diOdhGz6bWVdcU2fVRyMrSeH8tRxUjhaCrBBZvyAu2VDKFe/boDNf3tLbYJjLTr NQf9JJYntkoP8A2QakZ5S091ZSya0yqoT7JLRIo6y/RGZUHPwIOrr2Z8oceeTkgBSh3nO8 F2U1N3E7T0mqmH+boV5zNwiUZ1/mDCI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725608480; a=rsa-sha256; cv=none; b=XZKwlB3VPYU3ZNxOmWhR1DZcxY4ufenzWoOdacF9QZ7ERrmOOo309GIDxLbq8eJEzvMS6Y 8tAGNelHwd7TS+mLzbuB/twIvMDEZAa2LtM7aR3Isj5jzwMGjli7pEuuiuXmpR0Hy9dEOa DXFl094NXAyiueQtdsQaX83D3Cw0IKo= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4X0Sqq6QV5z2DbrH; Fri, 6 Sep 2024 15:42:31 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id A48851A0188; Fri, 6 Sep 2024 15:42:54 +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, 6 Sep 2024 15:42:54 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Andrew Morton , Subject: [PATCH net-next v18 08/14] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Date: Fri, 6 Sep 2024 15:36:40 +0800 Message-ID: <20240906073646.2930809-9-linyunsheng@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240906073646.2930809-1-linyunsheng@huawei.com> References: <20240906073646.2930809-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: 9pdndh3uoenyx83mhgy49s3wt3miz3j6 X-Rspamd-Queue-Id: A13AA100013 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1725608578-517899 X-HE-Meta: U2FsdGVkX1/QUwQdOE2ejKTAwjqvZ4JMlPZ0mpfaGlNCLlsOzJiaOBwOds24I4mqt57m7Qny6uxtWlclk8bNyd2ImiSEukPKVUBgrcYhczOUnW571BPX7nmH+z9RSht/IO6KebeWrMMTMDpiiyw+tsO7SDGh76vuA7rZ/O9jBdTj3oIRp4XsTgpD6wahqR9DcLhLI1nUayo1vz0oy9Ux232HxHSLVyUyUHQmO6R15ZRIVtIhTOEWvpi9opC5izCq7tcqxmvpvlBgbToPgCFHOh1s6afHkym2qpRdDSTD6Ce+8FslbZLPBLejL0pb5k3LvlCZ68rotmMwQe9DKYrUSqo0718HKtVyi16/uUuT3+JXO146JDcg07oTwE1BfdXigYO3ccFfI4p/Arvo6IAJZgRyY/wr3Dm0WsyTI6xSNvLmyG+PkP4Y8HIC5X7PjBx7+l/ts9YqYQOssSuL80ie8P8/Cj5gYlX2b2WpgWDwW45m0WvV7U4m94toIp0CDe2WF0hJnSnh07124oE5pmq0Ja/tGZoyUk0U6RBCWw/wrXTq1uNDVX/szNFzqcgvN21rxgwcl26i/62dJ+148BwxGwpic9rqX2IXNEzCaDIXCIxj0nvMDJtOOsjzWGvs6fuM4ia9cz+vetp6CtylOtuaCicVvutvgI7yCD/HgFqaLiouUVY6KT43In79sHuRrwj5L6TOQlB5LBdeTpB9e6pYQqwIUPvwf9O7YAfT3BnFN70fStklwAtzElVyPROEldsrDhOPBwnUc2iMUh4cxGvalo31i4ytcrKiQWTJL/Qa+y7X65l333XloM/brSHvKj2ASBil9gGQ4Y9IlpH3P8NKXcrXtWoMhReono4tYiBS+QoDpR/W7d3fEyaGNewDy9tck0Kg+BR30O8hRlPodFcsBRSSqpspKeE1G+u/nopWx3DSagVKSIJTmVevbxPrjtGDYLOC10gj+HU+T33wmuL 2R3YD9ib 2ORTIBU6lyWjxSxhtt/heY1t8tW8aqy9321NBSF9x4uqAxpbBJR/vLozdCQ5LIy5xcwi8f0rjeuVSb87sQSwPTckyEaEMlNCCE2XlObsOKUBpDTTfBZhY6d/xL4kx22cd7rqpQ1/ICbRjc+NcIvyPh6Oq+wPgQ0ruBdBH4M9P/XzfwPfsjPw+KsGQK7TqscB+S9HTP5wt8cdhzm5cvY1IwZNkulaDYZD4ZXbr6v3T9Pz7kjzq8ldvJdaS4nXbHjhJp+fnKxSsp43Vk6x+xaj+t/P/LHh766x+h+O5 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 6f6e47bbdc8d..a5448b44068a 100644 --- a/mm/page_frag_cache.c +++ b/mm/page_frag_cache.c @@ -61,11 +61,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); order = 0; }