lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191121151811.49742-5-fly@kernel.page>
Date:   Thu, 21 Nov 2019 23:17:56 +0800
From:   Pengfei Li <fly@...nel.page>
To:     akpm@...ux-foundation.org
Cc:     mgorman@...hsingularity.net, mhocko@...nel.org, vbabka@...e.cz,
        cl@...ux.com, iamjoonsoo.kim@....com, guro@...com,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Pengfei Li <fly@...nel.page>
Subject: [RFC v1 04/19] mm, slub: use for_each_node in get_any_partial()

In get_any_partial(), we want to traverse node instead of zone, so
use for_each_node instead of for_each_zone.

Signed-off-by: Pengfei Li <fly@...nel.page>
---
 mm/slub.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index ad1abfbc57b1..2fe3edbcf296 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1905,10 +1905,10 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags,
 		struct kmem_cache_cpu *c)
 {
 #ifdef CONFIG_NUMA
+	enum zone_type high_zoneidx = gfp_zone(flags);
 	struct nodelist *nodelist;
 	struct nlist_traverser t;
-	struct zone *zone;
-	enum zone_type high_zoneidx = gfp_zone(flags);
+	int node;
 	void *object;
 	unsigned int cpuset_mems_cookie;
 
@@ -1937,12 +1937,12 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags,
 	do {
 		cpuset_mems_cookie = read_mems_allowed_begin();
 		nodelist = node_nodelist(mempolicy_slab_node(), flags);
-		for_each_zone_nlist(zone, &t, nodelist, high_zoneidx) {
+		for_each_node_nlist(node, &t, nodelist, high_zoneidx) {
 			struct kmem_cache_node *n;
 
-			n = get_node(s, zone_to_nid(zone));
+			n = get_node(s, node);
 
-			if (n && cpuset_zone_allowed(zone, flags) &&
+			if (n && cpuset_node_allowed(node, flags) &&
 					n->nr_partial > s->min_partial) {
 				object = get_partial_node(s, n, c, flags);
 				if (object) {
-- 
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ