From patchwork Wed Feb 15 15:24:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13141809 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 5C210C64EC4 for ; Wed, 15 Feb 2023 15:24:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B31B76B0078; Wed, 15 Feb 2023 10:24:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AE3216B0075; Wed, 15 Feb 2023 10:24:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 982846B0078; Wed, 15 Feb 2023 10:24:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 849096B0074 for ; Wed, 15 Feb 2023 10:24:34 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3407E1405C9 for ; Wed, 15 Feb 2023 15:24:34 +0000 (UTC) X-FDA: 80469898068.05.174F419 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf29.hostedemail.com (Postfix) with ESMTP id 6112F12001D for ; Wed, 15 Feb 2023 15:24:32 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=W9zKzHIS; spf=pass (imf29.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676474672; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Lr8xw0GpgSDinfISjaWLMj9pTWMR4/E0MtCDDZjeQGc=; b=R7SYswvgYCsJEIckWSTyXHeqG/hVl2NT2n+31EqOtTvdcDJ2O9jf4c+IuGY8E2kgYjMBle GZsCMTjZBUELKUWjRZiDGZwPIuQU2ypVjjJhl9dgTLdx7KkmBTXvwt+LWowp0EnIDAm+uz i6wpdxJWHLsk1Eqg3PryuLpNyWW1Ix0= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=W9zKzHIS; spf=pass (imf29.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676474672; a=rsa-sha256; cv=none; b=QbnYYiw1PtsruZiTbMynp1JPiyxuEeXigbtuTirvRKLORfnWDOTeA3xbAjuppP8fxoqKMC J2+8g89JMLmFY1VMzygAwDUhXp+5tFHtSdSMZfZYNDnFWnLxTQRa2trdQh1rYpBJinroDI 2Yl48Vg5pUyuby/7UBllFSUyDXTwPhc= Received: by mail-pl1-f178.google.com with SMTP id r8so20591553pls.2 for ; Wed, 15 Feb 2023 07:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; t=1676474669; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Lr8xw0GpgSDinfISjaWLMj9pTWMR4/E0MtCDDZjeQGc=; b=W9zKzHISha0iYW/fT1pEEv3c0rpU7JwDYPQqj5Akevx4weqg5i6aiGnqqnQoAB6sNL 9HN+vOpU5Hy6HvbWyAlxSHfCP2/0FaxcOL6NC7aJfvpF6axDLBki7tSl6RSQKT9NxUUW ki7COyGU4H5z1EaEwwYDNKXJDrAstXSTb4PH9en1C+htebAMcr5DxxKAyWk7n8ZP6p46 BzZb5k31PveTQfRF7eqxggtZeDvzTTtS8Vi71Jl9hQDH5vnIulvSl7/HUczeBhArpIv0 uJT01WDmpsNnKlqQMP/L6ijRF60B2MzUPcPnGRNBB4twji16iGLuI1Eb+8CSBsl9CcvP pzYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676474669; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lr8xw0GpgSDinfISjaWLMj9pTWMR4/E0MtCDDZjeQGc=; b=KNC89ToThER0V1dDQSHBZLrODCdOKvo+T6aWB9YbCbLnaXUCyI4tKBQkN4sdVQqYcf 5+lBdaFD8P2XmD/B2GpqrpStQIdw7ZUrCGvpRnUIUQqLyJQmcFpKzjaz3hzQc4gBQLmB hQAVVND586P2Nk8cGOLB1pJDiiQPsutIX3qVXv191ycj0Bh6UbeXA60fgtk4IX0Aw+AS 8r2o8dKFNK6I17WdKSiHArfOShi0FtkHH0cHtIdh2cN9RJKIDwJX9P3XRfuf2+0ODHUf x5zcVuwzlrHkS6gyr3n4ubvfr1/GVHOa9UHlGyvGqnXfbUmWaW3Hw8YsTimnDBggGpvd GXGw== X-Gm-Message-State: AO0yUKXUAV9M33uInzVq9KxuFHBwqi0aY32brWzyRZazbKlv94KYnJjP Bch6JP8XM0XIYSb5NpECYTtn1A== X-Google-Smtp-Source: AK7set+RUAUcoLYSoBP/GpqNloklYT61Pcwdm3S6pccP6ySG9Lt6wUWax8Gho7oJN897Iy82IushWw== X-Received: by 2002:a17:903:41cc:b0:19a:9269:7d1 with SMTP id u12-20020a17090341cc00b0019a926907d1mr2937874ple.4.1676474669132; Wed, 15 Feb 2023 07:24:29 -0800 (PST) Received: from localhost.localdomain ([139.177.225.228]) by smtp.gmail.com with ESMTPSA id jh12-20020a170903328c00b0019682e27995sm6176997plb.223.2023.02.15.07.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 07:24:28 -0800 (PST) From: Qi Zheng To: akpm@linux-foundation.org, vbabka@suse.cz, david@redhat.com, rppt@kernel.org, mhocko@suse.com Cc: willy@infradead.org, mgorman@techsingularity.net, osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: [PATCH 1/2] mm: page_alloc: skip memoryless nodes entirely Date: Wed, 15 Feb 2023 23:24:11 +0800 Message-Id: <20230215152412.13368-2-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20230215152412.13368-1-zhengqi.arch@bytedance.com> References: <20230215152412.13368-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6112F12001D X-Stat-Signature: 1z7sj6bffowccb7apiwn5sw3bqgte9pw X-HE-Tag: 1676474672-247939 X-HE-Meta: U2FsdGVkX1/FSdLOs1QGR3+pcRk6F1m8qnTpirHiCUHgVkdZHCegF97URVb2juUx7PAZo0c3TwIKyu7fV+tyNprAERSVBBm2GXN0AwbClDxjdUrLs9PoRcr90jqus3gAWYG4w5Zk0zi3bQiwU58cEs1Xrdu0IRwOPTzFLlwbncHw5fM5Tt6K8/4N+ZjsVNelNQq15E8e1yNrsimSrCQvzoiMf/VunED3lv804tLD4Fn/P+bc+lRMnXhQisryrMu3uW17ZSrv3VL7yRzzTxPzC8o9NjrVeU+iWsIXg2FC/vZxPbpyNuXnfdyeayYj1DL5OsTSFOI2yz5y+E8xINBi5GfcSEeVR4Gmf5QC++APm8mGltJe7NJSPZMKsTFKncERl4vaXubbOrlhOeldDdwmPREhqK2PYNeE0aSqRkHWRzDLIoZVHWC8zd92jmiBojsMRgw3WU2PynbRed/ax2lqkN9pxrfRvnjdqYHtIMsK5k9nSSeyvrqxmL3ntP9Gt93BVPVFvgXyhzf3+R/63mrRZtAJs11U+dhLRcTdHAIKpf/lMRT/y2xXUjPhAYJIeDnYYcIqNRnmy1H4R7mBJrp6uT0nBgMmm9GDYt7pJ09d7onFEP9abCGhW7pvYWBdPnIWLtezgEhR7A6yOlKw1vx5HvLweLPcAEgD7346Qnb4dSh6TbeeXzxolP0SRftWLUB8NEXwpS+3mhv81XxBcFmW6XRpEd2HnLewtHSskZuOGkj6+MUM1j/UCBLhkXThzoSnTZmJXE5JaYHSYxt4kKZ2dmnBIklZzQquVo7wrqEe7WtrPXGyG9WNlOSqYaAJrsVY3RlGFwciCdisSrLF1g5COiHPPqZ1QioJw5lqiRUWwgPsEX6AZ9xfuhTYBzFBFrPApQi4IL0YZ5CrSMkLyo9SEJ7joPQPbFME75DdTfwvYI4cM4IOZ6tcEA1A+S8+LAj6EcYO5WFY0BmftzgmIbj BOaRV/uh 3Nvsah5QAuQTqx5ckce27BDAJdfbxFKg2zQf7u/jo4g6JhPNl94UfRy73DnVPLcwPxvt4+AKcGpe4lqmxff62Dy3h1UqV+0fQCwdWEuh3w6QyoYdUbTlJkd6zw4jurh3y+b9EtE3nYViNkIx7WkCLaQaPhXTawuzjgtv/L5Cs7BNGS3r/7bgwi8n/TUGQm/WSZc+CdEiev8JvEKlhC4KXMsAGxlJVmOh9K2fYWHI9w6d1W7VqB4fZK9W8p54glvR2EZgHpAIkVjMCjXUviXmAEhBt9MJ9x85Zizi7aIBjqj4RE0+UBj2bGvkzUiAOnRntF2cNW6yZg1HBgf+Xbw7vayt0ADWS6KOHzALWnEEuTD4W6+G4KJNvX8u8qDeNWd+J9OMau/ccth097n5qo1+4Ck8wCBatTgPn9sHySJGpjQJjSEpfBUcwycjmxLLkM+YiBAdOBGCqh2TmUOWZDQAplx72HO1uqpv/y+Ebca04eD/5LzIwphVJl07pEwxvr0g7bm7uf9pVgiNid66mfAXgLG1ytw== 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: In find_next_best_node(), We skipped the memoryless nodes when building the zonelists of other normal nodes (N_NORMAL), but did not skip the memoryless node itself when building the zonelist. This will cause it to be traversed at runtime. For example, say we have node0 and node1, node0 is memoryless node, then the fallback order of node0 and node1 as follows: [ 0.153005] Fallback order for Node 0: 0 1 [ 0.153564] Fallback order for Node 1: 1 After this patch, we skip memoryless node0 entirely, then the fallback order of node0 and node1 as follows: [ 0.155236] Fallback order for Node 0: 1 [ 0.155806] Fallback order for Node 1: 1 So it becomes completely invisible, which will reduce runtime overhead. Signed-off-by: Qi Zheng --- mm/page_alloc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0745aedebb37..f0b17dd71bec 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6377,8 +6377,11 @@ int find_next_best_node(int node, nodemask_t *used_node_mask) int min_val = INT_MAX; int best_node = NUMA_NO_NODE; - /* Use the local node if we haven't already */ - if (!node_isset(node, *used_node_mask)) { + /* + * Use the local node if we haven't already. But for memoryless local + * node, we should skip it and fallback to other nodes. + */ + if (!node_isset(node, *used_node_mask) && node_state(node, N_MEMORY)) { node_set(node, *used_node_mask); return node; } From patchwork Wed Feb 15 15:24:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13141810 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 86253C636CC for ; Wed, 15 Feb 2023 15:24:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 258926B0074; Wed, 15 Feb 2023 10:24:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 207E46B0075; Wed, 15 Feb 2023 10:24:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A8A66B007B; Wed, 15 Feb 2023 10:24:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id EF2226B0074 for ; Wed, 15 Feb 2023 10:24:36 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BC0E91408D1 for ; Wed, 15 Feb 2023 15:24:36 +0000 (UTC) X-FDA: 80469898152.14.B6913B7 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf26.hostedemail.com (Postfix) with ESMTP id CADA214001C for ; Wed, 15 Feb 2023 15:24:34 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=adSfwx2l; spf=pass (imf26.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676474674; a=rsa-sha256; cv=none; b=3c3kul0U4r1r35qIYR7vbryrIdUzfS+5r6aSqftoT7fENCCj9E4zcZOL72gAJsBugJvqE3 3R0O8tWS/AvNfxAHKnueotx/ZxFMpsiKUjznmBW4k4lV0vf+KjUsxnCrwH9oaCUcb5mizi x4ghfrnOHwx2OHViBI4f5nXvk/vJpyY= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=adSfwx2l; spf=pass (imf26.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676474674; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fbuK2YMcZd4/efbG59qp7NEzWA/KfSxPQatjxKotauc=; b=1n+u70+ljko2D1KHyeKMMgsKzDHmiBdxL9i7BOAhLASgnH1lQmaCof16mW2vGlPuT5+WXw 8Zgu9EMXGLHlcFrcUGIVEQ7q0FnNiqCD6RQ734l2zpcDvy9IRmOseqeo+7OPsI/UyR+iua YgcougdpSu5ZCmTBBiVwjYM97IFn3JQ= Received: by mail-pj1-f46.google.com with SMTP id w14-20020a17090a5e0e00b00233d3b9650eso2518749pjf.4 for ; Wed, 15 Feb 2023 07:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fbuK2YMcZd4/efbG59qp7NEzWA/KfSxPQatjxKotauc=; b=adSfwx2l32cZymQNminNVdHL2V/I/UNjOjzh5lKsvkexWwnjiH5rIingtZCu1DO0Zp jt9zT43qtqTSVqkSMXDZAaZ9lC/mjdJP02G2rHS2NzoTXQuGzhzJoyeGxK5e0owMEY/s +zfyEAak3Fqy4QHhXlChAVjxVq9bW96/nKkBEq9JmaduTvwuj1ER733aq04/+UFXgYKF 6oAOkCrTlHGKswvHLjyM8BNr/9VTEY2vQS70SU3O9ASt3aHZfLnMC4bMVOW/syQ5y4yQ WDj6iLQ03mE0hiwiBAxVUzGUf5F4WJQBXeZL+/s7HW/Z2DfASpWfpWXGXbxciKWOEYop UM+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fbuK2YMcZd4/efbG59qp7NEzWA/KfSxPQatjxKotauc=; b=GnxeMpPyzbCNGcTL75VzEMisuQztGHVNFlKfZXn/3T+5u4798Gih10b4CTwjc5P6mD qpEmcYAcxcbAJtgZkMPPfzwqKTPc0aWGVKcxhvH7Cqn1muiJVeAt6x1m6yMAcYfZ7B8e v8QWVqJ2SdicSAllsU77/XhMIqzu7JYL/7Hb178Hewn88tHsAWf/Ei8m5q7f+0I5YsaR Cif3xnhA/lxwlEAWQ9qhL3GyiNOrfJGTCEBmBlSuGSh6oo992jVFujhFpls/iH8dS/KN Ug42bKvha2v4uQb13Rx9iDtO4+xlWkjBW+hlFTWhdLB5plif2tgJ20py3xgirMfQA1J3 uqTA== X-Gm-Message-State: AO0yUKUPKESVrXqLXQdAJspOq/lvQ40XF4fV5rnJBuUy10SgrBhwr/dG j20fWB24B4IJB9m95K5dgIqsKg== X-Google-Smtp-Source: AK7set8V9Fqs6trOvhUW2rNiDUj3z7a1R5k34O15orz/UDYcujudEPAHsE6rEO85Glc49uzLAaJxNw== X-Received: by 2002:a17:902:e84e:b0:19a:a815:2877 with SMTP id t14-20020a170902e84e00b0019aa8152877mr3242820plg.6.1676474673787; Wed, 15 Feb 2023 07:24:33 -0800 (PST) Received: from localhost.localdomain ([139.177.225.228]) by smtp.gmail.com with ESMTPSA id jh12-20020a170903328c00b0019682e27995sm6176997plb.223.2023.02.15.07.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 07:24:33 -0800 (PST) From: Qi Zheng To: akpm@linux-foundation.org, vbabka@suse.cz, david@redhat.com, rppt@kernel.org, mhocko@suse.com Cc: willy@infradead.org, mgorman@techsingularity.net, osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: [PATCH 2/2] mm: memory_hotplug: drop memoryless node from fallback lists Date: Wed, 15 Feb 2023 23:24:12 +0800 Message-Id: <20230215152412.13368-3-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20230215152412.13368-1-zhengqi.arch@bytedance.com> References: <20230215152412.13368-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: CADA214001C X-Rspamd-Server: rspam01 X-Stat-Signature: wtthhgg8mpig9uyc66qskwmyexg3x4y1 X-HE-Tag: 1676474674-959879 X-HE-Meta: U2FsdGVkX18Rn9vqDXrRRF2XQCkUjgMaADswkRsAlAfnkmxOOz+zCtke4+JyYO4u5NQoyDSkPQ/BKPiqmSGyKtai1Xwp9gcPkKRD4GGDuBzZrZjo3BOZXiwvQACiQxHrxiqWPXZfamMNt/iwrhv0tXEEagja7ycO4Zj0k7UwXfVqSAZNdwNCQF9lll5COrnV9SjSkJcx3vpWXZl5efUWToqJTbTSWLd5J6Bir5ZOfIOWPgXPXgG1SlV1zvo+TsDwEOPXO8/Fq/MH6BBXjmShTBzSUeRBMeCwm0OvbhF7DYOssZtFIqps7/ivJCQNWShRY7LcMq3qm1fRgTXgtGM6JKhUz2i6ENSbz1rD8RhMAHYzfu+wlIgHm8en3jBJCDGldVCzL1S1Czns8pvNDOGdK4NngA+ZAg8sFInPZEc2hBMgBFxTbwg5ZABZe+5YUKUDCSnobvkxFKb5FxjomiZCj5xwLNSu8NRfx75glwOqKUGqvguxvNp/VswywTrbCaV2IqMahlQnNbZexMdUOK3lDGUnRXnnZBH5NfB3k8B2NpjyPv7+plbHCb5KEk5ZhH91LRrhN1JNVE/Ch81QptZALx5GDU2lIAQvj1sAeD51aB9qbRTtM3aXfClnxaXreGLwZ2iERk9h/2Otw28JXy/pL0deKYDGZ/DmJyEqVMP+zA71x1W0OYwFkskSt1UWXav3iDCtaClq00XwQ8wLaYhCPmrGqXwLQdG/FjEiLF2A0O3LKyyLSEJL6Ua4od3JzuNVy7bveG8cfe6u8zsofQim1JwyhFHXUmmzgldhqlzEPWEtpasHP84G1PEWzHspcCG0epZQLH3EIKYCCgZl0MmayDCixyh9xIO8u5LR1oQnLA6Vb67dszqPSEaX6MR55Cc7D2f0MT1Tdr/XvPra7k22H1zu7d96H3j/WzUBpM4EyAcmEVog1Ozh5joauM2Eg8rAQyO+KfQ5CKNjXkvqLY4 Bu/aK8Jt 31/NYSsE9K88rYhgx7PblK6Gixzoz1Awb1jiswYLeqCvnukLByKSdRa/2pU1r6Pv4cAYdbDH/+zbphxblRDdUCfztTSTnPEOV/RwOiMAn9dD/w1wyOV64V142xeUbAoa43PnrlN6DziU4HRGfBVm7vnjGkWdVfxy3Vs3FYDPqHUfsC1srM/SViFxn7bOPSJSN1RHsCTBvbNHM8rtEO45KkLSIQvOOMsOOHdXt0jRUZ71sqM74yK2VIIMXBvO+aVY1XDOjQt6FqmQDe65N3QxSXoFxCDW5ATo2Hc0NUQ6kaMzSRaaLLlKN8686ycakyq+aYRuEhpqzUks7v+XyI1i7LLV8c1R1DgoCFUzBjQLMSWCei1uNnW5T8yakLVuOAUb5gXf7z07h5kVskaj/QiI8ZtSggtFPcFMQOmutU+/b54PCjWdQdASgnRxyZmyDJX/Ca64XWKswfruF7ZHtyZ9h/qySpwxxUYtWXekWyaQL7wJc+Cl9FDy1dt9T9bSVL20OrAeZwjHXCRq6g25czH7i8uIwIg== 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: In offline_pages(), if a node becomes memoryless, we will clear its N_MEMORY state by calling node_states_clear_node(). But we do this after rebuilding the zonelists by calling build_all_zonelists(), which will cause this memoryless node to still be in the fallback list of other nodes. This will incur some runtime overhead. To drop memoryless node from fallback lists in this case, just call node_states_clear_node() before calling build_all_zonelists(). Signed-off-by: Qi Zheng --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index fd40f7e9f176..1a5e5e8f7e13 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1931,12 +1931,12 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages, /* reinitialise watermarks and update pcp limits */ init_per_zone_wmark_min(); + node_states_clear_node(node, &arg); if (!populated_zone(zone)) { zone_pcp_reset(zone); build_all_zonelists(NULL); } - node_states_clear_node(node, &arg); if (arg.status_change_nid >= 0) { kcompactd_stop(node); kswapd_stop(node);