From patchwork Fri Jul 19 09:33:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13737064 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 F19E2C3DA59 for ; Fri, 19 Jul 2024 09:37:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 118E36B0082; Fri, 19 Jul 2024 05:37:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 02AB26B00A4; Fri, 19 Jul 2024 05:37:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D23AA6B00A5; Fri, 19 Jul 2024 05:37:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B1F2A6B00A3 for ; Fri, 19 Jul 2024 05:37:22 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6A03116054D for ; Fri, 19 Jul 2024 09:37:22 +0000 (UTC) X-FDA: 82355999124.23.5524501 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf03.hostedemail.com (Postfix) with ESMTP id 2FB9220028 for ; Fri, 19 Jul 2024 09:37:19 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721381806; a=rsa-sha256; cv=none; b=7Eg8lMMz3MTxvpy1rm1AyGeTM0NSQIiLRT1vaQd7Re2acy6oZmmOToVf3KbfIfTaaBspGy 51Ht36whFUkPMWGiyxisFy7w2nZG/d7boifo6PY0Riuo6XEFfbNir+flBTHwxLJdhMBUim uaZbon0z0WmUca/0Zu3+ch2jAJnswFA= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.255 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=1721381806; 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=BHkSfjIc7PZKepsvDxB8U0zVA7w2TZyI6yUdnmqKbm0=; b=I0BydvFGy4KXpTAKuiuQNA6nmXvHIALSS2MHod7V5J94nVANRVT8Nnhb1z3P1Nh7wgvepb lxG3nGyJ/ezDj8R68I/9dxhga4y8+iiPEcdDXLV/ZMlL/xqrMGovJKWhU8iwR1cQfXzEVk 3DmNlzCGHnhmRvrO69gu91iyWImkUmI= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WQPbB1GPJz1JD7H; Fri, 19 Jul 2024 17:32:22 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id 8408F1800A4; Fri, 19 Jul 2024 17:37:16 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) 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, 19 Jul 2024 17:37:16 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Andrew Morton , Subject: [RFC v11 09/14] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Date: Fri, 19 Jul 2024 17:33:33 +0800 Message-ID: <20240719093338.55117-10-linyunsheng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240719093338.55117-1-linyunsheng@huawei.com> References: <20240719093338.55117-1-linyunsheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf200006.china.huawei.com (7.185.36.61) X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2FB9220028 X-Stat-Signature: 6iaeg8xj918kaytso7r6rd4ub1c3bjrt X-Rspam-User: X-HE-Tag: 1721381839-549884 X-HE-Meta: U2FsdGVkX19IhQHINSXUMTMJqPnlhllP2uGUboNqjGrMgad0L18KllJ7cNnp2lTFsEwAztJ0WRzgP4N7LACOfusCBBPkXeoR8F417Sh8c6X16SwEbIWTuu7RJIRVg8tPHxPf1pGeA/DI1K51T1lELm4qzpBoiuGwEV3aND4+ajT7nneWWcgOmQwpUedqef28sj0RUPlY8nnBwNMG5OMLsS6akXMe1Tk4NK85Pul5X8u8UHCBLvAoTz1iYLDSE1Im8qz8wCgGMJUEdFyzrSd0fiVu+aCPzOlrWXM3PJSGEcf62moXLRl3JjiVhovTVrnO3c9b07je6EIn+LICYf511hZQld6nIhp2xoWd0TgdUAshUT9of1i6DrxdgfDmggtV0EF7kv9rI4n3q8ye1pFQaLiNxp+cp0ruCRA78I2YVsahVN0nRSZFtLwPLhQQkc+pjjwVBz3yfvQnO0b8pvA0SmzLEZ5ayFfV7mqZsnr4ZV25AzpscrVD7O+rWIFdkCNO0k9Xv8N1MNUPGAHk5z7N1/wxWbKdaWpk0sNsBAxmepZxNp8XjDuObvjZBzhDub/mqTdm3df92IVwutxNZ49vmVn0Xiv7IMmWwsK0hXpMdGM2LIdJGlCJ0mxWzonSV1LrF+wvn3ZzidycRKoWKPv8fZUVhQyGV4ldGPEbNNq/mxYuCAVxxpvMtQSHkkNTCn3Azvm2R8gveK9YyjB40DbTaKGX8umDf7EuDfFs54NwfnEiQX731jtwlV5zzpQF1tCxpq6qF0sLN0ImeQUAyIGuh2eShIYnfcJpV7dPeYVFHpAwPIwtxtGbBDy8z0EcTlD0M6Enq66yfFv/fnPo+IcoyH+NLajcbr/BcT9aimZHZ2I+rhgff/F6Xcz12RzGrJZ09FFdVENbR5Ju0hckIss6BQ8ww2e1OmmgMoMQ8c1GQ6ve2T0XfkuNE87OTihbzUDFVlkiaacNLpejQxt3r9D nb+c4G0p B8koEvosru0ytjkoTTQPPZV2rnVCxsOSCqhz/6hjVvHBpXCKW7YCDgySXjwsLW9LAvGDRA5SUNt3SknimcLUAFCxWWtSBGgVVnboG3itnYWtFUX35QDGqBBRax82jjNoLn5VNUpE6iAG6iZ6G0jSdSF02b6/CuPq2Gf4Piurj0WZjQ8XyalF2de3p+jX3cLRarBQsMw5IBtC3LoMP8xqm22D9ZnCDpS1RSAN/htAO9pMU4bn7w5HazvtBieVNpuPapmwkUG8YMeFwVeTZV4XOWtPE+pkrY6W16WKm 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: There are more new APIs calling __page_frag_cache_refill() in this patchset, which may cause compiler not being able to inline __page_frag_cache_refill() into __page_frag_alloc_va_align(). Not being able to do the inlining seems to casue some notiable performance degradation in arm64 system with 64K PAGE_SIZE after adding new API calling __page_frag_cache_refill(). It seems there is about 24Bytes binary size increase for __page_frag_cache_refill() and __page_frag_cache_refill() 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 still 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 d9c9cad17af7..3f162e9d23ba 100644 --- a/mm/page_frag_cache.c +++ b/mm/page_frag_cache.c @@ -59,11 +59,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)) { memset(nc, 0, sizeof(*nc)); return NULL;