From patchwork Sat Oct 12 11:23:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13833398 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 7BC31CF2567 for ; Sat, 12 Oct 2024 11:29:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D7F66B0095; Sat, 12 Oct 2024 07:29:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 784C46B0096; Sat, 12 Oct 2024 07:29:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C47B6B0099; Sat, 12 Oct 2024 07:29:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 301E16B0095 for ; Sat, 12 Oct 2024 07:29:55 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5425C416D1 for ; Sat, 12 Oct 2024 11:29:51 +0000 (UTC) X-FDA: 82664730708.14.DB13E78 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf15.hostedemail.com (Postfix) with ESMTP id 36705A0002 for ; Sat, 12 Oct 2024 11:29:48 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.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=1728732547; 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=oxu8hSzwpd+A1v2yAfTKABFCS6bAIPSzf9AqtIU4SqM=; b=f7EV3n7iaiJDpH+eUj4/0vXTTN3vWc5JTv1V++MZx1UkFKg4CjqJu+uShTQtGSH1qCKkOv JRtFo3cG5P3j5VxYhHFxT7PVQ54sxiCiJKNGjNQYJ8Da0GT4XlqK9D0r4XVQXI7yvlcMuT cU9JOr2oX0In3sIGHIJEECUBBoKGfVc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728732547; a=rsa-sha256; cv=none; b=1gN+RcSfJqzWHZuFS5K7CZ9Jmg3mZQJLnpjau8Ajr4PWhsRrtc8hFJR/6n/RbRVxerLwbg PE9Di6eR9Xhv55RKN/Jd48BECtbtdOWQcc1o4i0g35JGf+PRbToawfdhjliDuVcQv1DLxX u06jftUp7+IPz7uE3PaLRO5bzylo9HU= Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4XQh883ZRrz2DdSc; Sat, 12 Oct 2024 19:28:40 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id A03CF1402CC; Sat, 12 Oct 2024 19:29:49 +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; Sat, 12 Oct 2024 19:29:49 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Alexander Duyck , Andrew Morton , Subject: [PATCH net-next v21 08/14] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Date: Sat, 12 Oct 2024 19:23:14 +0800 Message-ID: <20241012112320.2503906-9-linyunsheng@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20241012112320.2503906-1-linyunsheng@huawei.com> References: <20241012112320.2503906-1-linyunsheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.30.45] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemf200006.china.huawei.com (7.185.36.61) X-Rspam-User: X-Stat-Signature: j1z1y4kq897m6zdnuixzs1r5393j1jkh X-Rspamd-Queue-Id: 36705A0002 X-Rspamd-Server: rspam11 X-HE-Tag: 1728732588-730304 X-HE-Meta: U2FsdGVkX19NKInQU7zZMkpYGWh2pCM3ERa1xS+skYOPYDZPLC/TX2F2Xozgx2nB6hL2zZ6Z0XiI3tl6NeHD0ue4nHlRIVnnwayZk7EiBPV+mVz5sO9KBDGKmllAeeaBHZkYZRQz4+PaLUOTNLWlBJcW+ofV+rwYay6WREeGFX4E9/8f4GVI+Ddju90n8EgcmI+2gm2qulKY2AMV/lnVjPd7Le6ldvFHlwP0qnLpxrrBc6wrbLsNAZ86nVjmIl6ab7W/deBdoABOYFrN4RTUkv2j5PKhGr7ZAoyYzPmXsHP9mFOcCXqFGpUGH2K7z7GN2AiHn4+SPMB+xTb+bwoxd5D95g7wVQPUup/H8CMXDIZJqYMxkFnlM+T3WBJLKwJ11GrBIhExTHtkeeasRKs1I0mtD4OciNBEdpWFysZ3kaNLUjtOATzfGt5L7ZeiO8Ks+kbMDMsQAgGCMhmA8wXGNV9AwfFrWavE9BcYTo5mhed+0/a8YJ3BG/qqY7bIesbbIQgMSKbtbgmezQqnFISZmDZrR9w/3u/V3gTcIuf3sZxiZUafxqEiUQs8VsA3UOBcTn1mCDO/R8xfY3X9elYQh4E9TykOzWbjZDAF21/i0z7V85kUULDji/cA5vzLmZzYqUHI5VJECJJkyGWBDFXV4ARhnzZsGkz2xLEu9jKRLEIjQ+vPAt/jskO75jkgudVq1brhcR6nMFbk6EyIOGtQ3Ydv93hvNqsc9OHzaEXsPmqTzZotAZC0YTsJmMCYMPKSfdt6xLLNTznqvDX1E71+S9yHHWkwQDAhdkDOLDx/HGIKSoKP/E2Ev5CAjGgWq8V7aJZsAxRx/vxIxo9o3K9xN3bzySRNnI9DVhwGJWmdncZXwSiaJpVu0aLnD/jO4QRx92iF/CUkM86HKypcdwp3YnVWOBhm/RI5PqDEPrEcH45hIV2mH2lkzx6gPYpTnKsoXfimf2rvdS+i9vtRFfR 7LdsrQkw RpsgqOoA0FGwTc6I+Ht52B2hx5xpaNBIoLZNqr0qG74AK3aaA8/xMIrtRhrlRtWKUgdDHhHS7nz1STJWcJG3QUGnwcLH4Y/4L+OLKPnbBjRTooK2wWBFyVV0kB0sReH3YU5GnmIjDwd5pbZeSSgEXW9BLHAKi09kR8KxnPUEPuSMDoo/HPpgZPjVwOZb6ds9zSj2POz1ZJr4q5JHSGnZzGpgq/CxQzpVVdM5f1Tz4xrwjnKpSdYbY03xOkIsoGZZ3mbSi1iVsjJiVf3toqU2SHfg1iMqi+5wAdgzVK3bowld7OPYAKXJLPlTr9g== 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 Reviewed-by: Alexander Duyck --- 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 a852523bc8ca..f55d34cf7d43 100644 --- a/mm/page_frag_cache.c +++ b/mm/page_frag_cache.c @@ -56,11 +56,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; }