Skip to contentSkip to conversation

mm/mempolicy: use NUMA_NO_NODE

PATCH Superseded Jianguo Wu 3 participants 5 messages Sep 16, 2013 – Sep 17, 2013

Subsystems (2)
lore
Share & tools
lore

Jianguo Wu

author
#0 lore raw

PATCH 1/1 mm/mempolicy: use NUMA_NO_NODE

Use more appropriate NUMA_NO_NODE instead of -1

---
 mm/mempolicy.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
mm/mempolicy.c +5 -5
index 4baf12e..4f73025 100644
@@ -1083,7 +1083,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
 	tmp = *from;
 	while (!nodes_empty(tmp)) {
 		int s,d;
-		int source = -1;
+		int source = NUMA_NO_NODE;
 		int dest = 0;
 
 		for_each_node_mask(s, tmp) {
@@ -1118,7 +1118,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
 			if (!node_isset(dest, tmp))
 				break;
 		}
-		if (source == -1)
+		if (source == NUMA_NO_NODE)
 			break;
 
 		node_clear(source, tmp);
@@ -1765,7 +1765,7 @@ static unsigned offset_il_node(struct mempolicy *pol,
 	unsigned nnodes = nodes_weight(pol->v.nodes);
 	unsigned target;
 	int c;
-	int nid = -1;
+	int nid = NUMA_NO_NODE;
 
 	if (!nnodes)
 		return numa_node_id();
@@ -1802,11 +1802,11 @@ static inline unsigned interleave_nid(struct mempolicy *pol,
 
 /*
  * Return the bit number of a random bit set in the nodemask.
- * (returns -1 if nodemask is empty)
+ * (returns NUMA_NO_NOD if nodemask is empty)
  */
 int node_random(const nodemask_t *maskp)
 {
-	int w, bit = -1;
+	int w, bit = NUMA_NO_NODE;
 
 	w = nodes_weight(*maskp);
 	if (w)
Signature · 8 lines
1.7.1


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jianguo Wu

Use more appropriate NUMA_NO_NODE instead of -1

---
  mm/mempolicy.c |   10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)

I think this patch don't make any functional change, right?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#2 lore raw
Quoted 10 lines · KOSAKI Motohiro
Quoted 6 lines · Jianguo Wu

Use more appropriate NUMA_NO_NODE instead of -1

---
  mm/mempolicy.c |   10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)

I think this patch don't make any functional change, right?

Yes.

Quoted 1 line

Thanks for your ack.

Quoted 4 lines
#3 lore raw
In reply to Jianguo Wu

mm/mempolicy.c static inline unsigned interleave_nid(struct mempolicy *pol, · line 1805

Quoted 7 lines
mm/mempolicy.c +1 -1
@@ -1802,11 +1802,11 @@ static inline unsigned interleave_nid(struct mempolicy *pol,
 
  /*
   * Return the bit number of a random bit set in the nodemask.
- * (returns -1 if nodemask is empty)
+ * (returns NUMA_NO_NOD if nodemask is empty)

s/NUMA_NO_NOD/NUMA_NO_NODE/

mm/mempolicy.c static inline unsigned interleave_nid(struct mempolicy *pol, · line 1812

Quoted 9 lines
mm/mempolicy.c +1 -1
   */
  int node_random(const nodemask_t *maskp)
  {
-	int w, bit = -1;
+	int w, bit = NUMA_NO_NODE;
 
  	w = nodes_weight(*maskp);
  	if (w)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#4 lore raw
Quoted 11 lines · Cody P Schafer

mm/mempolicy.c static inline unsigned interleave_nid(struct mempolicy *pol, · line 1805

Quoted 7 lines
mm/mempolicy.c +1 -1
@@ -1802,11 +1802,11 @@ static inline unsigned interleave_nid(struct mempolicy *pol,
 
  /*
   * Return the bit number of a random bit set in the nodemask.
- * (returns -1 if nodemask is empty)
+ * (returns NUMA_NO_NOD if nodemask is empty)

s/NUMA_NO_NOD/NUMA_NO_NODE/

Thanks, I will resent this.

Quoted 6 lines
Quoted 6 lines
mm/mempolicy.c +1 -1
   */
  int node_random(const nodemask_t *maskp)
  {
-    int w, bit = -1;
+    int w, bit = NUMA_NO_NODE;
 
Quoted 6 lines

mm/mempolicy.c static inline unsigned interleave_nid(struct mempolicy *pol, · line 1812

Quoted 3 lines
mm/mempolicy.c +0 -0
      w = nodes_weight(*maskp);
      if (w)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>