Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3368343ybc; Thu, 21 Nov 2019 07:21:20 -0800 (PST) X-Google-Smtp-Source: APXvYqx1UGdqu0hPThk0Ndy8jRee6UD0YTHFZmZFgEQLPLKdR9BufwSV9fbUfyDLJRLFtBCeEHSN X-Received: by 2002:a05:651c:1a1:: with SMTP id c1mr8184097ljn.23.1574349680216; Thu, 21 Nov 2019 07:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574349680; cv=none; d=google.com; s=arc-20160816; b=S4SCfaMaQcxK21m49Il+m3W6TaMUL4TC/qxbBh3RAhLHnUZYfG/H6K4PI3srIlX4Q7 B+t+W2viNP8W3VsFoTelfOvu9EsSE4rS5FB+Z+QbpYpllKMn2Cgx8ugCCglHy/A5L35j aEW2Qww+MRb30OBBBCshEoCn2teuR3KzMFspN2U840XSLnTpcycqbWRkANsLK4rStQhw ZnvNynJVVfPjw2nnDzfiGbXaPo+CVp6Iu2zN8v96OGMr9H/MobmE9qPABU2zIG7MooLa +8sdZec8XpqXYgqDJgORInrztgv0LCexNInrtBu9KKCvTQ1fAPlKkB98m/HYlMEAP7pl EEuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=DsmrvI7IIenrQWCxySbYuplxiyrCEOArhlvLHt5Omks=; b=DsWXMYnEK6dtrmfoyTD8JtrH4ZMiuhj9Xskx9AM5DeWk7JTh0sNWKtRw//GObb7qwo M0k60TWhRjl3x7IbNAQwpHrq33PMtvZNkXx5J/WXQajNTHzn+yixIaBqXIEwnHndv4yP T6fGDnR3J88fnierKGLRHgwjw8/8TH3jOSU0bRLBCmzLsuRCpzTaHxCt1ofKIOls/JbJ jCWruJcoAX8zho8h2XDnRQRbmqVnA3TP1tZAYVKcivkXbYl7pjVSTaAAnqg6Wu/3xR6x yCXe4TsN/CgiIw8BSIF+Qe58PS+Wo267e+yxmL+3z2hHMTndaUDUthz59/PYk99GuxYu lVrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6si2072427edr.294.2019.11.21.07.20.55; Thu, 21 Nov 2019 07:21:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726833AbfKUPTj (ORCPT + 99 others); Thu, 21 Nov 2019 10:19:39 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:41523 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbfKUPTj (ORCPT ); Thu, 21 Nov 2019 10:19:39 -0500 X-Originating-IP: 153.3.140.100 Received: from localhost.localdomain.localdomain (unknown [153.3.140.100]) (Authenticated sender: fly@kernel.page) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 6C8521C0004; Thu, 21 Nov 2019 15:19:26 +0000 (UTC) From: Pengfei Li To: akpm@linux-foundation.org Cc: mgorman@techsingularity.net, mhocko@kernel.org, vbabka@suse.cz, cl@linux.com, iamjoonsoo.kim@lge.com, guro@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pengfei Li Subject: [RFC v1 00/19] Modify zonelist to nodelist v1 Date: Thu, 21 Nov 2019 23:17:52 +0800 Message-Id: <20191121151811.49742-1-fly@kernel.page> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Motivation ---------- Currently if we want to iterate through all the nodes we have to traverse all the zones from the zonelist. So in order to reduce the number of loops required to traverse node, this series of patches modified the zonelist to nodelist. Two new macros have been introduced: 1) for_each_node_nlist 2) for_each_node_nlist_nodemask Benefit ------- 1. For a NUMA system with N nodes, each node has M zones, the number of loops is reduced from N*M times to N times when traversing node. 2. The size of pg_data_t is much reduced. Test Result ----------- Currently I have only performed a simple page allocation benchmark test on my laptop, and the results show that the performance of a system with only one node is almost unaffected. Others ------ Next I will do more performance testing and add it to the Test Result. Since I don't currently have multiple node NUMA systems, I would be grateful if anyone would like to test this series of patches. I am still not sure this series of patches is on the right way so I am sending this as an RFC. Any comments are highly appreciated. Pengfei Li (19): mm, mmzone: modify zonelist to nodelist mm, hugetlb: use for_each_node in dequeue_huge_page_nodemask() mm, oom_kill: use for_each_node in constrained_alloc() mm, slub: use for_each_node in get_any_partial() mm, slab: use for_each_node in fallback_alloc() mm, vmscan: use for_each_node in do_try_to_free_pages() mm, vmscan: use first_node in throttle_direct_reclaim() mm, vmscan: pass pgdat to wakeup_kswapd() mm, vmscan: use for_each_node in shrink_zones() mm, page_alloc: use for_each_node in wake_all_kswapds() mm, mempolicy: use first_node in mempolicy_slab_node() mm, mempolicy: use first_node in mpol_misplaced() mm, page_alloc: use first_node in local_memory_node() mm, compaction: rename compaction_zonelist_suitable mm, mm_init: rename mminit_verify_zonelist mm, page_alloc: cleanup build_zonelists mm, memory_hotplug: cleanup online_pages() kernel, sysctl: cleanup numa_zonelist_order mm, mmzone: cleanup zonelist in comments arch/hexagon/mm/init.c | 2 +- arch/ia64/include/asm/topology.h | 2 +- arch/x86/mm/numa.c | 2 +- drivers/tty/sysrq.c | 2 +- include/linux/compaction.h | 2 +- include/linux/gfp.h | 18 +- include/linux/mmzone.h | 249 +++++++++++++------------ include/linux/oom.h | 4 +- include/linux/swap.h | 2 +- include/trace/events/oom.h | 9 +- init/main.c | 2 +- kernel/cgroup/cpuset.c | 4 +- kernel/sysctl.c | 8 +- mm/compaction.c | 20 +- mm/hugetlb.c | 21 +-- mm/internal.h | 13 +- mm/memcontrol.c | 2 +- mm/memory_hotplug.c | 24 +-- mm/mempolicy.c | 26 ++- mm/mm_init.c | 74 +++++--- mm/mmzone.c | 30 ++- mm/oom_kill.c | 16 +- mm/page_alloc.c | 301 ++++++++++++++++--------------- mm/slab.c | 13 +- mm/slub.c | 14 +- mm/vmscan.c | 149 ++++++++------- 26 files changed, 518 insertions(+), 491 deletions(-) -- 2.23.0