From patchwork Tue Mar 26 06:11:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13603604 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 AAB63C54E67 for ; Tue, 26 Mar 2024 06:11:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21C5C6B0082; Tue, 26 Mar 2024 02:11:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A7C46B0083; Tue, 26 Mar 2024 02:11:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EEC2F6B0085; Tue, 26 Mar 2024 02:11:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DCCB26B0082 for ; Tue, 26 Mar 2024 02:11:51 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id AA7F9A077D for ; Tue, 26 Mar 2024 06:11:51 +0000 (UTC) X-FDA: 81938169222.22.E3FE8FC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf29.hostedemail.com (Postfix) with ESMTP id D207D120017 for ; Tue, 26 Mar 2024 06:11:49 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Je8SAL2+; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf29.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711433509; 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:dkim-signature; bh=62MNx0xItSDlm7BWyxiaL7hkcreRJtBILyc9X1U9tZs=; b=LHxmngvG2WmsnCLDcClLwPhpMIFzBICxy2FYMr2FOb0YwLjPCsH3lkGiCUGYJt+vLfuw9p MhJYkR2Okx9oBEQTtnq/5qrv6MOyjnpsBZal274zXSb1NCxxw66wtm/I8+5meKkO48ij2R WQW2dbgiUEJOvjY/oWnQHVZqAcZP7+Q= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Je8SAL2+; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf29.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433509; a=rsa-sha256; cv=none; b=8F+JWVyOMNCYx3/XipNu5dX5Oz2jrpuuVQZXJE8Eof3ANTjEDYs7cAoABfH1CUYyR/DxMG u7PA72V2zvozrr70AGZfssxZZCtT4ZGS//ZzjkAcp++KRRVvbMCO84UN6B7VQbyhuGXzNP ToSnk9RBE2aopFq/UyRqQMUTL2Lj50k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433509; h=from:from: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=62MNx0xItSDlm7BWyxiaL7hkcreRJtBILyc9X1U9tZs=; b=Je8SAL2+wQTEsk3R9TaXFK69xhKMQhoOou0+UeG5GipXqSj3eLShJ4x37/jthOjchuB+Xg HTnl5AFZBA4sPhHPOxG3BoV6qlKHupIw0rXXKVgEec+zDCb+Ds65bl/cNA/nLQwxR2Z6ga 4QKpoCorgMrIQXsGpD/vsVrsLsd3lf4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529-khvmhmd4O0GftrrRF8zAvg-1; Tue, 26 Mar 2024 02:11:46 -0400 X-MC-Unique: khvmhmd4O0GftrrRF8zAvg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A25FA8007AF; Tue, 26 Mar 2024 06:11:45 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5AFD110E47; Tue, 26 Mar 2024 06:11:43 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He Subject: [PATCH 1/7] mm: move array mem_section init code out of memory_present() Date: Tue, 26 Mar 2024 14:11:27 +0800 Message-ID: <20240326061134.1055295-2-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspam-User: X-Stat-Signature: 5ow4hrg4ezf6nsqkq7tbqiuc8p9yswso X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D207D120017 X-HE-Tag: 1711433509-24757 X-HE-Meta: U2FsdGVkX197vBpNn6yVybtB9mHkIbgGvHZXxcA0iF34tO3oIdaBRemWSKtPD/s2vjj4us+VdlRaR+4uXxP3IVzzS6ccERTWwmxwnnRBAabZK5LcKQkDo6CV5NpOKJuEOUwOz509Dw+oR/ZFJH8Hojo/promYdDLHBcfbP81v2uWi7WpeJP3oW6llEknVaJ1e++2+DfvjvogyZ4SLUsA4gDMGInf5lMRluDAu0uniMSMJ6Wbl7dG35XalcOJ6H9FeDxYUwcX+Y20aP9V7vckBOubkcwLYpkS/Y15f5ds4FLFe9eHnjRiS/O6NYmFnWBZtMKFBPdkmUdwINASDtiDKDHNk8J8P4ZszNar/eMCQeS8roAKunols1Kv5gOXYTdi0CSSBZ2KwhpxF9igh1258qn7WRRteq8MfcxQFDViHdHXrflJnHf4K1Gj82OXUBtyuiE79oCE0X4YPLxM1MsTrzTE3myWvDRVka41rRwl8ygfQyfBCI5fEq/1P0wefxAZ47oAZWQwmb9UNzfyhUWFSQ8luuShBOHmQYxXxR7kx+hqf9IVbjIzZUuSCXUwPcr+pGfQFmlxLnUQqWzAug9cHq1EyvG02djTtKGHa9lGsNP9hONcWt+kliq9Prl2X1b5kDTk6PIyKtMJ5rIkciL7CNhEffRMQWz/Ud9+/JsGGKg9u26xTzY7D4x0nLtNTgZkexWwsmIyJ9cm9G6+xwDAgnPIT8RoRlszR/LDtJsBIcBa+47iV5nwtVBet2EmnQg/ERmynr+torgJ/g3lKx4uXYbJXDBonqYiROxQaeMGuT7TdlX1Hj1uHbpnp3CFvh7WvjxuAUSsA2gQatCjweXyE3Y4yj+KyKic3zMItm5uDT2e5yTnIOUpmzFtZR9QVqb9SxNEYZ6fKSPRGrYtpdyBg+WqG3qTjHd7LA1CP5b4RsAg3aEx3QwE3dH3q8oDXsdAWfCTe0emAqZXmMLD+L7 twS+qImq s1/aD/OhkI3Z09WNNDGBkbw4cgSCSnZ1JN3ViFqpfHITTuCSg8DtvAGLVaxpXF2/o4MzHS2I7V9c6mz4Z/ft5KoZCnX9oNyKqhGU/HBdcikZicsMxsZZg7M7gahZrdAAdZnlv9zM253qQtkzya7W88G3XUvzkbJxIPyghdL8KjsXolCi27/rGMwCHqd57anx3f10XnvVWPYagTPm371zvoF33UQ== 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: When CONFIG_SPARSEMEM_EXTREME is enabled, mem_section need be initialized to point at a two-dimensional array, and its 1st dimension of length NR_SECTION_ROOTS will be dynamically allocated. Once the allocation is done, it's available for all nodes. So take the 1st dimension of mem_section initialization out of memory_present()(), and put it into memblocks_present() which is a more appripriate place. Signed-off-by: Baoquan He --- mm/sparse.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index aed0951b87fa..46e88549d1a6 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -226,19 +226,6 @@ static void __init memory_present(int nid, unsigned long start, unsigned long en { unsigned long pfn; -#ifdef CONFIG_SPARSEMEM_EXTREME - if (unlikely(!mem_section)) { - unsigned long size, align; - - size = sizeof(struct mem_section *) * NR_SECTION_ROOTS; - align = 1 << (INTERNODE_CACHE_SHIFT); - mem_section = memblock_alloc(size, align); - if (!mem_section) - panic("%s: Failed to allocate %lu bytes align=0x%lx\n", - __func__, size, align); - } -#endif - start &= PAGE_SECTION_MASK; mminit_validate_memmodel_limits(&start, &end); for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { @@ -267,6 +254,19 @@ static void __init memblocks_present(void) unsigned long start, end; int i, nid; +#ifdef CONFIG_SPARSEMEM_EXTREME + if (unlikely(!mem_section)) { + unsigned long size, align; + + size = sizeof(struct mem_section *) * NR_SECTION_ROOTS; + align = 1 << (INTERNODE_CACHE_SHIFT); + mem_section = memblock_alloc(size, align); + if (!mem_section) + panic("%s: Failed to allocate %lu bytes align=0x%lx\n", + __func__, size, align); + } +#endif + for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid) memory_present(nid, start, end); } From patchwork Tue Mar 26 06:11:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13603605 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 CBEAEC54E67 for ; Tue, 26 Mar 2024 06:11:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 469766B0085; Tue, 26 Mar 2024 02:11:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4178D6B0087; Tue, 26 Mar 2024 02:11:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26B936B0088; Tue, 26 Mar 2024 02:11:55 -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 08D476B0085 for ; Tue, 26 Mar 2024 02:11:55 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A58C81C084A for ; Tue, 26 Mar 2024 06:11:54 +0000 (UTC) X-FDA: 81938169348.02.C61CE0D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf21.hostedemail.com (Postfix) with ESMTP id DA2351C0013 for ; Tue, 26 Mar 2024 06:11:52 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cL5xYl+o; spf=pass (imf21.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433512; a=rsa-sha256; cv=none; b=Q/9CqbZXr/KKZA1uWpkdEtMmvYAwrJoZeHbJ6DDRNvt+51cOz6WD0XVBH+UD6klRIF0nUq Zu1xk6Ja/1Xug4srEe9qt0SH9jAZlDK6WNKzwv/noBUeGrXNHBFtJe69XcHpMolLo00jOx WxKscca1jYn6UXtOspOYN3M6ItQtzAI= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cL5xYl+o; spf=pass (imf21.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711433512; 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:dkim-signature; bh=wNbJUTamfWLGhNZqABfVMlJmVmVJ2sSKLjjKRbFhlPE=; b=LpdUaE5qbTCOsPGa/dKt74CgQBkDf3eGiTSHKX6LBDbkSatEtN8TsHXK1srsXorZcTt7jq wziknFEVzVx91yJ7ldcFfyYxHclCuNcVMg1ImH/FS5x3F0/79f8kAmPtm9zkzqYVwWo0gl AVjbebHLCn4SCO3s9UIAsA10vX1HZQc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433512; h=from:from: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=wNbJUTamfWLGhNZqABfVMlJmVmVJ2sSKLjjKRbFhlPE=; b=cL5xYl+oDeX5AXnJQH5WT3ojbTFgxNsHWc1jLr85O3Fv00qBIrwu+vAA2V7rJog58rNKwf TMhxjr07l+t1wX+OKK7+1fZSIk0W958A/KL24YNOC6Xo9kmTKEWTW3DI2hstuOcs6ey3R5 ZJNW5XMilSipM2XmqHlDQJRF7H7plLE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-272-DvusLvZGNKiU0Ubuav3P3w-1; Tue, 26 Mar 2024 02:11:48 -0400 X-MC-Unique: DvusLvZGNKiU0Ubuav3P3w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79ECC3C0D842; Tue, 26 Mar 2024 06:11:48 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43D771074E; Tue, 26 Mar 2024 06:11:45 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He Subject: [PATCH 2/7] mm/init: remove the unnecessary special treatment for memory-less node Date: Tue, 26 Mar 2024 14:11:28 +0800 Message-ID: <20240326061134.1055295-3-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DA2351C0013 X-Stat-Signature: 95zoq14a8rt9zefxjhyfzuzrpcm8nsja X-Rspam-User: X-HE-Tag: 1711433512-697414 X-HE-Meta: U2FsdGVkX18myxH5HKU+ImtBhXFudtHqI34qcMSWQu+XgdUASHmLmPWcBJG1eN/2gOB757WwYuiCP6EzZS0cHVM11vUaf3p96jwKb/0YdPGEy86GyExdJqyFHhTeBjamufAqPdXQRVxkv4NX3+mc928z7fqKxVzz4F/rKqDTI7gKdESWnG/cdnp/MbEN2yAxnV/TcctjkaC2snxsDIflc35mFirpjyISrYze4gG2OqdMWGAwFg049+PkoXegmTE6b+MP67mreEvUa4A4vg5xQjrm1DYFYSg3GiJ1VdGL745Vca/tDrk+sF3Rd+cWnkX5wRoNN/hqlfHv/JozlrMFgcMJrwTsI5t5F6gfZ/XIOXLs0NTNoYj/0plyt9O9ml9hFfloTDUeikb5Nt82w7fZK0rBRg/u/0c4GaFMKx+ftj9jrGlXln4HJ3MwYmPyAxNITSRbJgFGVGIsh/OF7ti8DbicT2HC6ESADC3Z35EhGGIkWRNn1f/0EWvbe+AF9AOg5oJmFUVFmXCwStbgMESVle8f1dNup/1aBlvMPBp/Ctl4u2f688HrFjW+QpA4nz8HUoNrDrwht5la7VbNqET4ZfQ14mcRrytvFZStboAI0j4KSCQQrEJ4emwdjTOD8Ia3qR+VWe1iQIlCNq2AWaQQzhrEGDK2/c7HDpuvwfiaOh0nfZyP0myCXd0Nmp6KId2jSVO80MR2tddotNkBIuUxy3yCO27A8bo/8fThLzpGi54t+pgIEhwVaZX50kdaTFZeJ0TlKC/cilvuQTP6iv1UZixLffAGLlsInRvHRSLTTcE7clGAO+qJP3l+7JtmRJeogOMTByTJYpihk/0wB4Amd8QDlGRlN9lxqd6kCSnLGEe0WmxAArVqfNV+dX7z7scPKZ/rpp3uyvg= 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: Because memory-less node's ->node_present_pages and its zone's ->present_pages are all 0, the judgement before calling node_set_state() to set N_MEMORY, N_HIGH_MEMORY, N_NORMAL_MEMORY for node is enough to skip memory-less node. The 'continue;' statement inside for_each_node() loop of free_area_init() is gilding the lily. Here, remove the special handling to make memory-less node share the same code flow as normal node. And the code comment above the 'continue' statement is not needed either. Signed-off-by: Baoquan He Signed-off-by: Baoquan He --- mm/mm_init.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index 089dc60159e9..99681ffb9091 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -1834,28 +1834,16 @@ void __init free_area_init(unsigned long *max_zone_pfn) panic("Cannot allocate %zuB for node %d.\n", sizeof(*pgdat), nid); arch_refresh_nodedata(nid, pgdat); - free_area_init_node(nid); - - /* - * We do not want to confuse userspace by sysfs - * files/directories for node without any memory - * attached to it, so this node is not marked as - * N_MEMORY and not marked online so that no sysfs - * hierarchy will be created via register_one_node for - * it. The pgdat will get fully initialized by - * hotadd_init_pgdat() when memory is hotplugged into - * this node. - */ - continue; } pgdat = NODE_DATA(nid); free_area_init_node(nid); /* Any memory on that node */ - if (pgdat->node_present_pages) + if (pgdat->node_present_pages) { node_set_state(nid, N_MEMORY); - check_for_memory(pgdat); + check_for_memory(pgdat); + } } calc_nr_kernel_pages(); From patchwork Tue Mar 26 06:11:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13603606 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 80462C54E67 for ; Tue, 26 Mar 2024 06:11:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BEF36B0087; Tue, 26 Mar 2024 02:11:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0464A6B0089; Tue, 26 Mar 2024 02:11:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDC306B008A; Tue, 26 Mar 2024 02:11:57 -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 BF28B6B0087 for ; Tue, 26 Mar 2024 02:11:57 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 93979807B2 for ; Tue, 26 Mar 2024 06:11:57 +0000 (UTC) X-FDA: 81938169474.09.C40B586 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf13.hostedemail.com (Postfix) with ESMTP id C6D5E20016 for ; Tue, 26 Mar 2024 06:11:55 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=M2IBkKuq; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf13.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711433515; 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:dkim-signature; bh=ebwXgacFwTWSBqTK2x7aW13vFuNcJjCDtd9AR2zCOQQ=; b=5KRhoqxm5PncEdPktnGdCq41nJ1I16cryd64hLz2JiGsHFpDGoPH+jHWBut2q/Fyj3LQVQ dVmeSu8Chyg+wECU9OFp9qqtSZ6uatuHh66EwSTwAvBPksUOzUZHr+azSSLRkocxldirR6 rtnH3mv3vbYphu2rYWeobXN+7OVaK3s= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=M2IBkKuq; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf13.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433515; a=rsa-sha256; cv=none; b=6L3wNEiKgBdqKkexB98+rmaz+I+8/aXvgqVVjrHRMCkr5OIEGJZF4IRLafTRcwspI/iXml s5wJPBck49II7eZRjw/Z0gNCVu+vSoz0Xm022HO59F0/8oEmiLIaxJoe0BJ8uiY5dhnPrV wa54ScfgihJzpP7pNpXL9mBDahUX9fM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433515; h=from:from: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=ebwXgacFwTWSBqTK2x7aW13vFuNcJjCDtd9AR2zCOQQ=; b=M2IBkKuqhPCnpaPzPmiYzGlt4sClkzkiUGerT9UARq9SipAnEwRM0npGteBigJDAD1gEVd QWTWrs57Iz8g9shOPOBQ48j9B8dm502DickZJT+EOULMN/VPIgxVXK6OaNLY3Jpn+oyXJg s8cbjYxWlyHJwZRjmMKBD4yn/5zBn5E= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-FfWr6qiGMXyTlucUMZML-A-1; Tue, 26 Mar 2024 02:11:51 -0400 X-MC-Unique: FfWr6qiGMXyTlucUMZML-A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C1BB1C05157; Tue, 26 Mar 2024 06:11:51 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B3FD1074E; Tue, 26 Mar 2024 06:11:48 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He Subject: [PATCH 3/7] mm: make __absent_pages_in_range() as static Date: Tue, 26 Mar 2024 14:11:29 +0800 Message-ID: <20240326061134.1055295-4-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspamd-Queue-Id: C6D5E20016 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 4eskwwmk3f4urfo1nu33d3ib4e9d1qgj X-HE-Tag: 1711433515-605876 X-HE-Meta: U2FsdGVkX18SXUcybvkG/vJjBr0vOCVowNqxlMe9fSZuMRFAEVVXuoBmBvWlaXqyhUiARleLttttXaKFK6jeqozHZ3SOSboI6xIA/b97ZgtCOI81gnavywaynKJq1kOvPlsAsxVNFBSsotjcxjPZjrahEGoji1n3PsLobbANo6JO46XIeQ0itrdZXEx+UYclF4iTeAjVBwUFVBttLPTL6tp6H5b2aHdpa4ebiP+LWbPeLwy8QoFOHdI55o5+n6OEzP7ZYD+bKQJRYCRMhC1qZIBHx1F78Y63VBsDyrMc2VaoA8obbYUZqMYMpy7Wahbjca060nlLDQQcHvpKMRMHpkaj9HM3zruUHJ7QQdpF0JGBDRdifBJAP8q1dX4x+dfCRi6U/6ZTsg3QQ837ZqEaCGdkwUd/sqABWKq+UjqEnwtRnfbCjao+8dFU6pt6I3G0iyIqjUd55d6+pGK5d06qJNYVD5MK6w88wbZ+mSrtYR9D4t3H16pFdRq8mZBdUqbCxzEeqDwgZ6E2Xl5RCQ2O29Wj2sALHIthAL2pHsnob1ZhPVF1ZCF6yDcbltxacfFGedvuoU6rlKAXzwMpjbzAw6+jEOfutHhnjf/qBXwPk0qMbrVyWqA88x45O5cPFPgH3NpO/4JJffH3sIFh/Gji7rNnFwSP+OUVjIUIJ3rFthsYEuW6u0RciuE4OJVKZ1Xs3cbB8+hLhY6ZkrlqvaZZmn+aUOZFVPel8AY9TvIOXXBZn8/nFOyP3C26UVBB4KziUHPf/GYX9HhbjlVjlYDRim6egkxHMLUbtWg7bfQdjCtkr2ecqMk+4gx/WoMuhUZvCJu1YZZBZrBx4tBCznTfi6EVa8NmMrtNUPX7WOy+tlK/WRUB4pKZihYZ+8TT3jJCMO6TRvXIVAZVAdv4XDnUSQO7LLunDyufCBgImYRdVuQ3Zjkip2UMnLL8/3Ius9M6H5K5Owm1PL0M7dvRfge sfOIsBTn 4v1b394nzsQm+9APl5RfDu43/nOD8NedsvOJ15u9ZkG8UlRHSyNXW3nyVtga7pDHnR1vcjrGdpmv1O0cLz9QwImeMRse4mQHqgm6wbxCK5duq4y0wCXqATxl1PJcCLaThmgy3sDJZJ2wvdwJiMiXpojCeJgJ2IFNOVzKlQadM0AEcJmloyInAUnLFNxxL6oqKQlcGyubHawvvd84sDvFi77NfCg== 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's only called in mm/mm_init.c now. Signed-off-by: Baoquan He Reviewed-by: Mike Rapoport (IBM) --- include/linux/mm.h | 2 -- mm/mm_init.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index ab1ba0a31429..74f71e802e0c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3193,8 +3193,6 @@ static inline unsigned long get_num_physpages(void) */ void free_area_init(unsigned long *max_zone_pfn); unsigned long node_map_pfn_alignment(void); -unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, - unsigned long end_pfn); extern unsigned long absent_pages_in_range(unsigned long start_pfn, unsigned long end_pfn); extern void get_pfn_range_for_nid(unsigned int nid, diff --git a/mm/mm_init.c b/mm/mm_init.c index 99681ffb9091..cbdb49cdd2ce 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -1143,7 +1143,7 @@ static void __init adjust_zone_range_for_zone_movable(int nid, * Return the number of holes in a range on a node. If nid is MAX_NUMNODES, * then all holes in the requested range will be accounted for. */ -unsigned long __init __absent_pages_in_range(int nid, +static unsigned long __init __absent_pages_in_range(int nid, unsigned long range_start_pfn, unsigned long range_end_pfn) { From patchwork Tue Mar 26 06:11:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13603607 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 C180CC54E67 for ; Tue, 26 Mar 2024 06:12:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48E2B6B008A; Tue, 26 Mar 2024 02:12:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 416656B0092; Tue, 26 Mar 2024 02:12:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 291606B0093; Tue, 26 Mar 2024 02:12:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0FC636B008A for ; Tue, 26 Mar 2024 02:12:01 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D624912097A for ; Tue, 26 Mar 2024 06:12:00 +0000 (UTC) X-FDA: 81938169600.21.21762FB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf11.hostedemail.com (Postfix) with ESMTP id E67A940008 for ; Tue, 26 Mar 2024 06:11:58 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="YzZ/AXsP"; spf=pass (imf11.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711433518; 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:dkim-signature; bh=NfvcuScu/5j6XehhHJA8UTonv32Il9vPsP21GJ1TIg4=; b=qS0XgIfndMUwbKPh1vD+9Es47au7OmM0eWrfHkbSHpZ0AadNm3U2bJG4A27HFpP2rn1c8E OuAWk6X64s1aF8PL/4Ew5YCLrwTa7MMkK/1ka5feN6AQeHI7CPlXUMftOeBcpcPKbBqf1Q o+ilbWs47F2eNg7Rji5rYSGbfBU84L0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433519; a=rsa-sha256; cv=none; b=oBuuF5Ptyl9qk1/AiwCrfZ2YFPNzmsiPFy6uLIaVDU8M4QOz1W23U9EsGZt07JrzMVUpfX A7ygfWov5QA5lToJ8z3QGxdc4d62mY5DecvARKEYwqzKGL48hAvoeNGjvxbJyVbULSMKzC XcY4gM0t0j3DXWoUDKCIld2jyian3ys= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="YzZ/AXsP"; spf=pass (imf11.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433518; h=from:from: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=NfvcuScu/5j6XehhHJA8UTonv32Il9vPsP21GJ1TIg4=; b=YzZ/AXsP1h0vsU0SBnqV5o41JBo4b6KC/PNzn/XS3rmehsOLdVf6vyuKPnLeC5UTVf5U9a uU4ZJaC420VpplWvEG5uU69Mk2NhzWPqw91swCwrz4ZGFvo7jbUiVZnynSvFLJuF0Q7Tnt YXF1i+CklMdhD6gQbB9J241cNgQKMKY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-643-BHZKVQPNNqCcwRYVUXtxlw-1; Tue, 26 Mar 2024 02:11:54 -0400 X-MC-Unique: BHZKVQPNNqCcwRYVUXtxlw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1E6971C00B8B; Tue, 26 Mar 2024 06:11:54 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E206A107A8; Tue, 26 Mar 2024 06:11:51 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He Subject: [PATCH 4/7] mm/page_alloc.c: remove unneeded codes in !NUMA version of build_zonelists() Date: Tue, 26 Mar 2024 14:11:30 +0800 Message-ID: <20240326061134.1055295-5-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspamd-Queue-Id: E67A940008 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: swi6hdk77ojwnmtpaf77b35d31zrbxm8 X-HE-Tag: 1711433518-836632 X-HE-Meta: U2FsdGVkX1+GuqCNcx/6lEgQjIRopG6dFCCq/RxWlxSrmVQyPKrg0iG5osUEBvaNdhLKEDYjVthbGNaVOv66YU02m492hXferXAoGosvFmzmixzHdApQ5vUnYa61QYxFpWauSKqSasMFEPLiGGCilRIn9hNvjMlBkSEv33yPahHg08Zj4ZELN6rmaICpipDgBtnmgPclFYsxKSMuH4wcKvbYs2UR8LYvJyVkgStSsX6wC/V/xOObHKDKMHpSZ/qcsjhQsGjSnvhkjg7hl9KB9Q7Wwo9NjUlvWcZhm6os3+sHZ4KWzBaLcRiP/Hy93IQMPw9CkovkjtnS6tefNjbIJkyyv6Z6/m3GskHgCWjLqiWxZknhRGKYmWhK18r54eyy0duIppNhRBZ4q8LPnxO1hJtAdMNMeXQqjbngrEk5xQbwNcWLl4MM3/XVL23tU8uLl4mcFY221ZdNe03iL2fbTpg3A2njovOPu6kZeeqGLSWDjgrwSObTdirQN9FU2kCWHvC0z8xhyL8GEbMYv1S9RI1JPR6x4lMS7KSvVztwzXPDpXBTq9O2kIDk5n6mJuYBNviEe98eeNvKh+Qxh9pz8z0iQdYvFSnrTUDHhi5Y1PLZuDuG9HXV0y2fho1+K3ZiZfSX9qg6Cw2fVk218LOMEmcn1PI9bTK9rmo7jiiOuXxJ62be4/QQyOUkyKFXXKnCnT6Go+73ZoWidpsMch4C3mi2SUIiv6AlXdf5ckVsSiJQ0SlCaz3WHn0cnQfAEvNFuDKqO6nl8JHHp+DmlQ1cR0F0jGvDFeurb+4/eclhda4SpLigYMI0myj1zmSfOGZ93Fcf7qARFb47zwl+Q0d3w7sThituVgPGMMFmh1yEXpLS+5o7KDnPljuMfEqMdg4GFYvP4p3vEei/PWa/Xsyqm3o6b5YEOtZPyMYez+XGskE9LeEtNQH3RkEAjx1aTWDkfOeZ0DBfwDifJHXqHRp +tkc4vyT Jxykh6T+ASxB8Bv6HVYLjTbMZn2g6EZl77Fh6YRNXzQ1aj88Blr/HgtfQpUbOOyDpgiZoVoaiapM4uolRFOQnY1jpBqijZazjuCMZRY/hWA328eAFOUyCTMIXEZnCytm27WfAUwyPRLVrdXs1s32+CZOy5EPGTUL185lXuoRazOqgRdOoCu8/Kb1wVrmnHISNJ+Ck1w7+lCr4Qcm4vkuvYI4DGldpXARWgaOZ887MLhnn3gSm/uGG/4PuI8vXl5u/fWhE 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: When CONFIG_NUMA=n, MAX_NUMNODES is always 1 because Kconfig item NODES_SHIFT depends on NUMA. So in !NUMA version of build_zonelists(), no need to bother with the two for loop because code execution won't enter them ever. Here, remove those unneeded codes in !NUMA version of build_zonelists(). Signed-off-by: Baoquan He --- mm/page_alloc.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 14d39f34d336..fd2b49aed59e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5190,27 +5190,6 @@ static void build_zonelists(pg_data_t *pgdat) nr_zones = build_zonerefs_node(pgdat, zonerefs); zonerefs += nr_zones; - /* - * Now we build the zonelist so that it contains the zones - * of all the other nodes. - * We don't want to pressure a particular node, so when - * building the zones for node N, we make sure that the - * zones coming right after the local ones are those from - * node N+1 (modulo N) - */ - for (node = local_node + 1; node < MAX_NUMNODES; node++) { - if (!node_online(node)) - continue; - nr_zones = build_zonerefs_node(NODE_DATA(node), zonerefs); - zonerefs += nr_zones; - } - for (node = 0; node < local_node; node++) { - if (!node_online(node)) - continue; - nr_zones = build_zonerefs_node(NODE_DATA(node), zonerefs); - zonerefs += nr_zones; - } - zonerefs->zone = NULL; zonerefs->zone_idx = 0; } From patchwork Tue Mar 26 06:11:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13603609 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 4D33BC54E58 for ; Tue, 26 Mar 2024 06:12:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CCBAF6B0092; Tue, 26 Mar 2024 02:12:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BBA776B0095; Tue, 26 Mar 2024 02:12:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A58426B0096; Tue, 26 Mar 2024 02:12:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8FECA6B0092 for ; Tue, 26 Mar 2024 02:12:04 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2EFE74091B for ; Tue, 26 Mar 2024 06:12:04 +0000 (UTC) X-FDA: 81938169768.06.8F3F5E4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 56237140010 for ; Tue, 26 Mar 2024 06:12:02 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZVwbHbon; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf26.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711433522; 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:dkim-signature; bh=26pF07psouxIQGL4z587QBIfGHVQZVYNO+cDKaqMYbM=; b=BH4L7+Lvh1pLPQrnbpclw0nSta9+lL7XM2+oUUEjyw51GCapJJQM4HWrxlTXFZqxMekQfV hcZ8/zKbZaMBFSie+SvxW6d5QF3H/G8Jfd5ASnCtppwWwcqKb2zOP0LvthsFknAo4AGjfn iDczoMtvW60c1sBkTg01TdS84vdS7wc= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZVwbHbon; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf26.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433522; a=rsa-sha256; cv=none; b=JAka51FZajsYIhyxWhve8Z5eZsKoHhOQrRZyrvvhGQPF8hmtccZQZnXc+FVcvxJKtF5Am0 iBb7SIllB2IEVyN5QW/mBqTQrLyN/qYvDg7buONiITjmYABJKPWFvrzQSC2KSSbvL1wpnR UAo+gYtMueczUpDbOIzZjbNJcF9cOpA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433521; h=from:from: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=26pF07psouxIQGL4z587QBIfGHVQZVYNO+cDKaqMYbM=; b=ZVwbHbonWcJHPu7vpmD6J0Wvou9NmS5hz4Wx7OYD4E8W9ErkUdPl3Y//ckGaJ8plroQIpG FPkI6DFlOqvJ1OKefwBBjITMihS8M2mJD6XnhZVK4ltQ7BRegIaQcPXdt3Ro7eGcnqQrCA ChjGc77YsSFyHCPD/7FKEPWpWZn/0Bg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-458--n3bVuZBMXeJhzzcqYgiEg-1; Tue, 26 Mar 2024 02:11:57 -0400 X-MC-Unique: -n3bVuZBMXeJhzzcqYgiEg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E671A800262; Tue, 26 Mar 2024 06:11:56 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3C9710E4F; Tue, 26 Mar 2024 06:11:54 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He Subject: [PATCH 5/7] mm/mm_init.c: remove the outdated code comment above deferred_grow_zone() Date: Tue, 26 Mar 2024 14:11:31 +0800 Message-ID: <20240326061134.1055295-6-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspamd-Queue-Id: 56237140010 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: a66w3k1yztd31gikcksd6o51d834c8z3 X-HE-Tag: 1711433522-649584 X-HE-Meta: U2FsdGVkX1/yNAbauXTc2+b1FGxJJEWXJ5fW9TVV5izHfn3fOZsPOhT4Ot78JQiYfg7za9W6UUE8Q4Vy7azR0X3+9Rd+yDKKyyibsiF25hv8XRICmcBPkbhPHakJy0agXJg4wd9S8VsweBSb4tppNmYDi8Ad4sxC5JJurPldIHtsK1QCArgxnP0p82JcDaQ6zWLkIzfgL7gOy1WhW5B0o+WpINJJgZEy7GkDpPZoNU3UcaFK3flJF+ls9DSSXgDcniWvjG3ebM0XHyKZBg1RmK8vRJ0c6qhv4BsotxevXVoS/p7FVz0SHm42kDC0LhRo3+y0RwhnXPaMomw9DYnPWD/RH5+Vh/FFc1FCxX7P4mWyT9qsIbguN5lfFcJ2DxxleR5Z826VWbvrD+MH44Eiz2R43w8Knc1+rw3tsXi8tKbKX5PP2Ki7/Tkbmwi6Yvpjy4Vf4OPTrBimmPQYq54L1vgWNNnc54bSqOZD0TG3immG1FMg1FmeLwu0pFswkem2Bs8lcfsY+/9SqUFe7wzNQGA/blfuHyvjNTFbzul2K3jpQ09z2vwIWq9PiY/pWcGmVEub6qGM3edYBmGNkfiFGfb/8Flr1HM6fgfL/dFQh5nL25q8XI3GiLwwdw88h1w+iDujxbnooDXT9WZFJ1Usjrv1uDjiYt1SAJqwpWpCRpxMxbVkkczHpB63cPM2x5znelf7fX0Y+wz9e3LLyGozta2nUZWZfBD8a/fC4s06L0w48RHzb2LqAni8mGJ+JL6JAWVolIq0Oxsc4zz+YQPuejpDVAjCfWmdW3WmJ5AV3HRcr7xlHe8IqNQ9sY4leNePHt8p/bOZusr8f4ygA4TkUCX+ZHyynUv4ti43Omrul4GrHENO7vMpB76nJmBgMdcQFwH5RAKPhYwOk+tYmOxSfPZ8uNXC+JQfiRoLo6mqmtp6s6YsfItf+q2GYXrrZzugZtrmgIfstKZ/I8k3uRb x+08GmG7 smIBr0J7YOPAR9ULANvGYaN1/1VZZf7Ud1rVeAYKwiOPTt+Uq4h6D7fi65G8LF9tH2DuZ47GBmSHfhu/ojFNGZ9ElbFXzTFpGtvhiJWA6RN6T0o4OVU7SzEHhQWosSss/MrfFlwBhhBXelo4sDuM6it0CBl0ftQdMRs3kYgJluBd+HfWlf7p7om5gAzle6iKJbEGhV7XkmW2XlIbaDntHS0V7lQ== 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: The noinline attribute has been taken off in commit 9420f89db2dd ("mm: move most of core MM initialization to mm/mm_init.c"). So remove the unneeded code comment above deferred_grow_zone(). And also remove the unneeded bracket in deferred_init_pages(). Signed-off-by: Baoquan He Reviewed-by: Mike Rapoport (IBM) --- mm/mm_init.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index cbdb49cdd2ce..cc24e7958c0c 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2006,7 +2006,7 @@ static unsigned long __init deferred_init_pages(struct zone *zone, __init_single_page(page, pfn, zid, nid); nr_pages++; } - return (nr_pages); + return nr_pages; } /* @@ -2208,10 +2208,6 @@ static int __init deferred_init_memmap(void *data) * Return true when zone was grown, otherwise return false. We return true even * when we grow less than requested, to let the caller decide if there are * enough pages to satisfy the allocation. - * - * Note: We use noinline because this function is needed only during boot, and - * it is called from a __ref function _deferred_grow_zone. This way we are - * making sure that it is not inlined into permanent text section. */ bool __init deferred_grow_zone(struct zone *zone, unsigned int order) { From patchwork Tue Mar 26 06:11:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13603610 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 8570BC54E67 for ; Tue, 26 Mar 2024 06:12:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 10BDA6B0095; Tue, 26 Mar 2024 02:12:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0256A6B0098; Tue, 26 Mar 2024 02:12:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF2976B0099; Tue, 26 Mar 2024 02:12:06 -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 AAC7C6B0095 for ; Tue, 26 Mar 2024 02:12:06 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3E81912098D for ; Tue, 26 Mar 2024 06:12:06 +0000 (UTC) X-FDA: 81938169852.21.87E88ED Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 45B4518000C for ; Tue, 26 Mar 2024 06:12:04 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ePEPeDDt; spf=pass (imf24.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711433524; 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:dkim-signature; bh=GXw1e1oHgEN9rl4kfr56ThO6wyh2Sq3AhDPjDs68OcE=; b=0YJfsTTO41ch2jdtri/ldTAhAIMUf3PVfgUKgyYarMqGAuNA+JW7WS7h8i9B0fOf2jcQOu gjBOkVegtPI9zrg9BaBGcz9Oodfgg/cIe7IEhJ4Ikw6Cm9vK2W2bnowBWxixB8GMEHhxC7 9zYGb0w8/O/kx7SmI2KkVkODqAp+Sx8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ePEPeDDt; spf=pass (imf24.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433524; a=rsa-sha256; cv=none; b=wp3/35g7CURpV8aIFqxVwBH3NIKveRhg+xWF5jUNwXvVXk9Ed/JgEqWoH+BiJUhSXlB6AI 69yCLy76swvyUtJGBXY9WR4HjHJl8ulVk3EsubT4Y62XA5pb1plRQzgwuGDg1aE9R0L/ub MTRsV8tXymWi9lMduNqlBiH5/pfn/Ko= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433523; h=from:from: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=GXw1e1oHgEN9rl4kfr56ThO6wyh2Sq3AhDPjDs68OcE=; b=ePEPeDDtfxPrsVP/KsYs7LLJnIirCQTeDO4YMVbe4XJRIDvUEuxipgARVo1cr0XFw0H+ue pCoXznKBNwNe/6DrynxTJjrocIDZr8m6clfyAen9RK1Sm2GdRM6noavvXV4IDcVB6j8nLw rFYxh8aJiE6lWFzbeoWyQlIcCIP+m8w= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-8s9IBzaPO0OZyDKnS2pGBQ-1; Tue, 26 Mar 2024 02:12:00 -0400 X-MC-Unique: 8s9IBzaPO0OZyDKnS2pGBQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BA3BE101A552; Tue, 26 Mar 2024 06:11:59 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 895FD1074E; Tue, 26 Mar 2024 06:11:57 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He Subject: [PATCH 6/7] mm/page_alloc.c: don't show protection in zone's ->lowmem_reserve[] for empty zone Date: Tue, 26 Mar 2024 14:11:32 +0800 Message-ID: <20240326061134.1055295-7-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspamd-Queue-Id: 45B4518000C X-Rspam-User: X-Stat-Signature: efi7r3bbqzf9ychzax7esas4pcb3ufmu X-Rspamd-Server: rspam01 X-HE-Tag: 1711433524-837889 X-HE-Meta: U2FsdGVkX194EA6DFx32JiT8ncRkGdQAXQGVSNdJAniDTaC61xkZzWUAhfVx/W6ENrXd2ighiJmY26n/aHd+LUGEg/gAX89oU3V/ls1sXx5pxXmiNKH6BID/hR5uGpYJX8ItLMJOSAUkrMYMxZvQIdCM8G+hMy8noWx/R+7+00jZQE7pS2g7jCQGzYrsuMtrhHFo2i6ktjrSzz1OxNAgjoAHQJ3vy5zDVYLEvxYJrcUMioBviwuLvKLZSTfCNQ9L2NjIZy+x9aSYwvFOKjXn/tDcDJ/lpfGVzHFHkIWNd6f5gl5MOUyKTYPBeW4qYt7eakQWVU6nHmRdZ7XgzcUwAF4c9Y8hJ7+Cn4cuNitpbQBPu+A9tivXz+gr8mQysqBLIL8GnLn4oj8ycWmtUAsl56SEnoTu5SlQltP363Vq58+jknqTmLTKDP0kIgm7XXesNQlDWeiZgcDyZf3ZvnJ6ejXFVz0XXn6zuMDulbBRMZ2YoqLzcOf2lauwrmLpFUXhhQSUEjYxp2Ods1VIAlI3uDzLJNUI4CzuZ4VF8Rzow91U48+FrgxmyyAqwJezpg7i90kZD5ekisqUSFHOXSwq+VyWXm1Z9jUE90vJhBwp5ugJ87vcX9BB4di2qQyOtUFrTwP5TDaJ0bkGSKQi4Jd3IG1SiBg415vuytCPN0XACiUUtLFln3C2nWYkPIFLfKb/jclfDmsTXhqqdBMt7RxCeT5RZqmrwrF0isHbHXXmBuf4WhANKm0NHWzChC2A4HJY13nGh4nxkhvqHTGApFy0omNBUKQlyFs2NLP5+ZUcbjmvJZmZ86Edx23brWVSj5OQzqKyy4yPBEH1d8UNchBQ/mlPVaCCZWy29z1VeyIsKqewP2PYxqgKkEFL8OrV4dwNAs9CbSRhDD/8tdN/H5TkAYxwP3vuCP040OGL2jTYjLh3K697gGgYjNjbvkyoMMa56rRxCLb5naB8b74Cc76 nUulGjtx NwEnj9wDLA7hVskej4owOlYpoba3gI5gVDsAHwe6HHWO9wCKSRlX9Il//kheKA114bZ1wLOApzX2QV7Z2oPtlksX1LilBYigZdzptsiToSTT2CMastDPH32of6FvAhNzRgQ5k9kb7xIgTtr7PtT30jJMF+3mQOX3nDqhA0uyY0Q4za0+6u4jVBHTWRJFn3e7/TADwskT0lTQYkZU98PoRFZY8KA== 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: On one node, for lower zone's ->lowmem_reserve[], it will show how much memory is reserved in this lower zone to avoid excessive page allocation from the relevant higher zone's fallback allocation. However, currently lower zone's lowmem_reserve[] element will be filled even though the relevant higher zone is empty. That doesnt' make sense and can cause confusion. E.g on node 0 of one system as below, it has zone DMA/DMA32/NORMAL/MOVABLE/DEVICE, among them zone MOVABLE/DEVICE are the highest and both are empty. In zone DMA/DMA32's protection array, we can see that it has value for zone MOVABLE and DEVICE. Node 0, zone DMA ...... pages free 2816 boost 0 min 7 low 10 high 13 spanned 4095 present 3998 managed 3840 cma 0 protection: (0, 1582, 23716, 23716, 23716) ...... Node 0, zone DMA32 pages free 403269 boost 0 min 753 low 1158 high 1563 spanned 1044480 present 487039 managed 405070 cma 0 protection: (0, 0, 22134, 22134, 22134) ...... Node 0, zone Normal pages free 5423879 boost 0 min 10539 low 16205 high 21871 spanned 5767168 present 5767168 managed 5666438 cma 0 protection: (0, 0, 0, 0, 0) ...... Node 0, zone Movable pages free 0 boost 0 min 32 low 32 high 32 spanned 0 present 0 managed 0 cma 0 protection: (0, 0, 0, 0, 0) Node 0, zone Device pages free 0 boost 0 min 0 low 0 high 0 spanned 0 present 0 managed 0 cma 0 protection: (0, 0, 0, 0, 0) Here, clear out the element value in lower zone's ->lowmem_reserve[] if the relevant higher zone is empty. And also replace space with tab in _deferred_grow_zone() Signed-off-by: Baoquan He --- mm/page_alloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fd2b49aed59e..ce1d12cf2ec7 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -332,7 +332,7 @@ static inline bool deferred_pages_enabled(void) static bool __ref _deferred_grow_zone(struct zone *zone, unsigned int order) { - return deferred_grow_zone(zone, order); + return deferred_grow_zone(zone, order); } #else static inline bool deferred_pages_enabled(void) @@ -5806,10 +5806,11 @@ static void setup_per_zone_lowmem_reserve(void) for (j = i + 1; j < MAX_NR_ZONES; j++) { struct zone *upper_zone = &pgdat->node_zones[j]; + bool empty = !zone_managed_pages(upper_zone); managed_pages += zone_managed_pages(upper_zone); - if (clear) + if (clear || empty) zone->lowmem_reserve[j] = 0; else zone->lowmem_reserve[j] = managed_pages / ratio; From patchwork Tue Mar 26 06:11:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13603611 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 D7FFCC54E67 for ; Tue, 26 Mar 2024 06:12:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68A9D6B0099; Tue, 26 Mar 2024 02:12:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 614DE6B009A; Tue, 26 Mar 2024 02:12:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 417BE6B009B; Tue, 26 Mar 2024 02:12:10 -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 2C59A6B0099 for ; Tue, 26 Mar 2024 02:12:10 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 04CF516098B for ; Tue, 26 Mar 2024 06:12:09 +0000 (UTC) X-FDA: 81938170020.25.425004B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 236B4100002 for ; Tue, 26 Mar 2024 06:12:07 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KQUM+TY7; spf=pass (imf14.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433528; a=rsa-sha256; cv=none; b=cUT00Yhl8Oj3QInE1eKFYKbUvzRWX1rbgLuTUVJ7iZXMjqrW/tvm2xtIf3infF34fNkmnh tuLnqhqG8HSp4MgX5a+Do2NepM7iKjtFLNIAKDR8fP1pEmnoKd2l+CbyotyQl2yTuHvPmA e/bL9qBkG0wNFhmqa11h/WKfH9/uVPo= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KQUM+TY7; spf=pass (imf14.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711433528; 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:dkim-signature; bh=5++WqQNUkBC8lt2n6PufkCB9EJJxn34hVbC1UG4qfn0=; b=LbmaWjkfzZWUT5ufY79X62rBX6Fypn6AMHz/9whrpK2hoTYG8Lrwy24UiTlecXtWdEK22A 9CbaGA5mvv5EuMhJ4rzieTPDJOMkZtsL0hW9fHDofmJGp98igje1ldQNQCRrkNnZEa6odh rTamjhHGbV8N0CNDR+EHtWm5mZw9HoM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433527; h=from:from: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=5++WqQNUkBC8lt2n6PufkCB9EJJxn34hVbC1UG4qfn0=; b=KQUM+TY7SzidSOnje8YhYuKDQm8nQzsgGlWZA7pacerJ4Mw88cCburtZactCMDUHB2RgHF pMgzQtsJ7Fr2V098FFoxvPLwUUVkvsiSD0xyrpTYq6GSddEoAxaIR7VS1v5PrL1DxAW/zu x8uAktF3JZng1LUys0ly7WWXPlqFcVY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-382-4Es8gUDVPT-zpcGukC52cw-1; Tue, 26 Mar 2024 02:12:02 -0400 X-MC-Unique: 4Es8gUDVPT-zpcGukC52cw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8DE55800262; Tue, 26 Mar 2024 06:12:02 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BBA81074E; Tue, 26 Mar 2024 06:12:00 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He Subject: [PATCH 7/7] mm/page_alloc.c: change the array-length to MIGRATE_PCPTYPES Date: Tue, 26 Mar 2024 14:11:33 +0800 Message-ID: <20240326061134.1055295-8-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 236B4100002 X-Stat-Signature: maft7am5ambifxmk9ga4j3bs6errfd4u X-Rspam-User: X-HE-Tag: 1711433527-71901 X-HE-Meta: U2FsdGVkX1+zLyE3SaSHmxQWR6/USRKI5Y3z5SUivi7VEw1QN20JL4Zgdk1PY0JeTNbKAYq2ZwRI/xZTxemvr478dKi9dawb3rLHRr4lbrabgU/XBBU2vVxg49guZCrOUQLKIJHmFIWdcp32CjnwqeZ6CtWhIpu9Q5djTyp62K3SViOaJ+FVJHZuqwchb/uBZwAfPsDwtIsraCMcH5ZuzYNotokyPGcdrScDyh8Y2BFsD56eBw8oJvjiCY7yye1lSbMOmLVy1qnhDlLAODOQ8AXkWzJqD2Nr223u8a43IGe/m+D6VhjOoVZh4qTrvetyLAvjpxXNdW8mqxivkuM/u5NbnoAxpMfe5UBIi/BRh1kghxNUT/qEDoh5/4wiFhQisgdejo57Que8AVta9cFZvtgJTUFdINWvyJUsJvEjEPR49rEpL4ASOWd4i3xN+rOOpauxtQ9e6evcGhrNl0Q/NvRhUgAa1ugyTkTyUJcVWPrYguOnKhSO39Ry7rUw6INUo7FdJk4XhuDkEljxC4oq83d/Y3HaveEaSA3FlQXu5knwAiznVYxJEWVFcaUfnN4DBuXxc4RKJfBZl7nLHEaCLJnyZyloE5GCa6AvfqHmJkSSzTJj+PSM4qS+Tp6J6E2IaBFPVO47NqxrrfZWwlIvuJ/+fnoadrsDvJVSa8U3cxQomA2n6eDWwMyohXIAA0UMfOVsQB4R6caEsWMY+bRFKbH33s2VanHYCzFSwPQp54+NhiAsZUkQ+THQeDqiYVQnhBH0T2BqaE4/R0ikygb+3qqo4B1C1ibwiHn9MDlJgpWx4nv/YfbsAKCojU7F7esd8r9XZDeGz6BFYB3eSdRGNM/jU/S5jpEtr/eukfnpKQ7rQJsBjivB6YWxfjrdleWtCktYDNyPelJ4Ks+dIBaLRQhXWn6dwKwoBnYRjLCiRlA+E7qbeI7yoxtBsIOQJOOxVQuSyt1kkBubNQB2+E6 rljeFj3o D91DWfOhIxkicRPo3MWj54T4mjS+N2Q6wzpehfELvMMDijx5YPZhsos0Hu9drQAeLLkfq75F4DC9JFJADu+f+kaWPsAjPIc1orgHdWo/qtjIMZwN/q2PtYuIARUJewHkw09qfDVieFWqEgDnSR3Q2Evp6nlHYup1ExEiJZean+bvA3sgrWVAa11biMbs+rurP9MCcDbunFdW2EY87kSYaasHD8Q== 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: Earlier, in commit 1dd214b8f21c ("mm: page_alloc: avoid merging non-fallbackable pageblocks with others"), migrate type MIGRATE_CMA and MIGRATE_ISOLATE are removed from fallbacks list since they are never used. Later on, in commit ("aa02d3c174ab mm/page_alloc: reduce fallbacks to (MIGRATE_PCPTYPES - 1)"), the array column size is reduced to 'MIGRATE_PCPTYPES - 1'. In fact, the array row size need be reduced to MIGRATE_PCPTYPES too since it's only covering rows of the number MIGRATE_PCPTYPES. Even though the current code has handled cases when the migratetype is CMA, HIGHATOMIC and MEMORY_ISOLATION, making the row size right is still good to avoid future error and confusion. Signed-off-by: Baoquan He --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ce1d12cf2ec7..b60cdcda46d2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1592,7 +1592,7 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order, * * The other migratetypes do not have fallbacks. */ -static int fallbacks[MIGRATE_TYPES][MIGRATE_PCPTYPES - 1] = { +static int fallbacks[MIGRATE_PCPTYPES][MIGRATE_PCPTYPES - 1] = { [MIGRATE_UNMOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE }, [MIGRATE_MOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE }, [MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE, MIGRATE_MOVABLE },