From patchwork Fri Aug 23 15:00:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13775389 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 915FEC5321D for ; Fri, 23 Aug 2024 15:06:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2868B800A7; Fri, 23 Aug 2024 11:06:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E814800A4; Fri, 23 Aug 2024 11:06:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 012A9800A7; Fri, 23 Aug 2024 11:06:56 -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 D03EA800A4 for ; Fri, 23 Aug 2024 11:06:56 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7A95E1A1DAD for ; Fri, 23 Aug 2024 15:06:56 +0000 (UTC) X-FDA: 82483837632.28.E49710D Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf17.hostedemail.com (Postfix) with ESMTP id 4079940021 for ; Fri, 23 Aug 2024 15:06:53 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.191 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=1724425597; 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=qIHoeO1xql+XVEKJR6q9hYgl8zcTGGL+wRC66wUUeww=; b=K+LFIouecrbg21Dgna2up360pOvOFSiXY5cPKczb8i/qJD1HQEqb9PMJE4ae1cTyFO+NaL 8MD4ux5Y3Uy+3oL3TsAJKdHZZaMznoQz9Uug35VTudiGUsaysipxlKevRLVd6VfgD8dK43 rs+FSr+q9npv+KBI8xVCxs9C2WVGbCE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.191 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=1724425597; a=rsa-sha256; cv=none; b=A2ebuTunGEgcEwxUfoH+oa1f1EQgcG7njo5vcxvomNoun6wFFNuoJMtMailHCSQr7U37G/ 9LbfXHmoxzCVt73NpmwA3qPyacprm7E2rlrXYebvyWWxQSFwLuURTalLcMKHp9vZ1Q4don 7SHWwKthQcqXfCAl523cELkCfSMrDAM= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Wr3Lq0Mr8z1j6QT; Fri, 23 Aug 2024 23:06:43 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id F278E14013B; Fri, 23 Aug 2024 23:06:47 +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, 23 Aug 2024 23:06:47 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Andrew Morton , Subject: [PATCH net-next v14 06/11] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Date: Fri, 23 Aug 2024 23:00:34 +0800 Message-ID: <20240823150040.1567062-7-linyunsheng@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240823150040.1567062-1-linyunsheng@huawei.com> References: <20240823150040.1567062-1-linyunsheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.30.45] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemf200006.china.huawei.com (7.185.36.61) X-Rspam-User: X-Stat-Signature: wbr7967he8wxq6p7hkomgitg8fj4ic3n X-Rspamd-Queue-Id: 4079940021 X-Rspamd-Server: rspam11 X-HE-Tag: 1724425613-11218 X-HE-Meta: U2FsdGVkX1+TDxLbfAluZeJYnSQnzmVN6TzTuyTTW9yWmqs7wiK3ZzNXKum7KaKmFtUQEjaQ6hGaljacZphxIn1ZY41jiOh/PjHKeqIlq4xvtrwnT2YOYkMuB8fU9wI5Qutw2xhr9D/HOvq1p4PaSPgjBbKmCBfH8tgkae/2gT65SnWtLPE77v8iMIA62h1O6drZslrHa2PPZSn4HrMUg4P81MOtUggoqDD7fuV/Ng9vPiw4vfZXBj6FBPrT69zEL55M4Unu18ap6+hc5Ek7P5slEMAAgAf49ubMQdKdGxmxFPkeoU0hatf5yGn6fjWHdI1jHUecoBybPRRy9Cz6aNp4BtPoRYaBSOm8316lbLAtBFblOTwq4LM6+xWwaf6DFS6ZTDfxAKnZtZn5TOLvW2hYL/fxL+zeAYcMixgjhjqStp9HJfX8Fa/K7Qai/gO3q2wjAmOzkDRrzlgqEJmehLmwOQIYHC69LVIo3gJzxb07sswcp1MyFLWrEZ2UtGUzJ7Yblf8IK5kKXgShnlsEHzDCa5m0Epw+mCMItPj+4WvxNrB7Yyz5iC42JQ8Rg8PL/MKgIAJbpE3wBjSMtRM5q15PrZ7BcQi0GauI3oLzSKLXkim4VftMZkY/qUfq0CHhJ6je//LsnzwGBPMMFPOHrhfPJ6OLk+jQ7Tlx/boWYtPlqaAiSaNRPR+BpYYrFLY5imNC5ZHLYhh6sYIf6nDvn41cXqrFTorA1P295L9iGM/jSW13ImZ1CFP/6bu3CCN+SckBgUnNvL44at3E9INXfHu0cTQxNOAO5+iIGcABtG3Iqq/xvOCaJUrFJnaH/r8Fecp9B5nEZ7C+RM2CHEQedJuJ0beVHaXgaJXXODw+DQEbPR96GYQsMnS2EpEJjIdkm4g8du0raSrzRbs4SSlz1g859GGeLg6KzvBS3KdUzayUDxh/9gG7j90GuRWr07ZRLnxkT8W/Vi8s2t4bDpb +3eBHSs3 m9BSbXsgKif8GlU8/BFaCMJPduZceS2Yd5HWvY2OEl8YEF/GCJ4D/d4Ij8qntUe1snGQGqSXbaJYtXc3NV6wk+4YED74/LVJvpfuM9T2km+MSj1jiP77+/KXkzXWfA4ApslD7Bvw2IoOyzgMrF0UPaR5GWEdZJ3Qad935mAbQCigtt1/+4YwOKw2tyV9M2NLoYpr0/kaGxt+IB7cbIzVYv9RqY3e+IGGH3Qg2XjryX3oF5kSnIIqaC+iHbcoV3MM4NoTntGIkezBt2Jrr1LYkNZULRkYR7E+YTygJ 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 2865bff7199d..b3053a0f38aa 100644 --- a/mm/page_frag_cache.c +++ b/mm/page_frag_cache.c @@ -29,11 +29,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;