linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/mempolicy: use NUMA_NO_NODE
@ 2013-09-16 12:53 Jianguo Wu
  2013-09-16 16:19 ` KOSAKI Motohiro
  2013-09-16 20:26 ` Cody P Schafer
  0 siblings, 2 replies; 5+ messages in thread
From: Jianguo Wu @ 2013-09-16 12:53 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, David Rientjes, KOSAKI Motohiro, Rik van Riel,
	Hugh Dickins, linux-mm, linux-kernel

Use more appropriate NUMA_NO_NODE instead of -1

Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
---
 mm/mempolicy.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 4baf12e..4f73025 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -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)
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/mempolicy: use NUMA_NO_NODE
  2013-09-16 12:53 [PATCH] mm/mempolicy: use NUMA_NO_NODE Jianguo Wu
@ 2013-09-16 16:19 ` KOSAKI Motohiro
  2013-09-17  0:59   ` Jianguo Wu
  2013-09-16 20:26 ` Cody P Schafer
  1 sibling, 1 reply; 5+ messages in thread
From: KOSAKI Motohiro @ 2013-09-16 16:19 UTC (permalink / raw)
  To: Jianguo Wu
  Cc: Andrew Morton, Mel Gorman, David Rientjes, KOSAKI Motohiro,
	Rik van Riel, Hugh Dickins, linux-mm, linux-kernel,
	kosaki.motohiro

(9/16/13 8:53 AM), Jianguo Wu wrote:
> Use more appropriate NUMA_NO_NODE instead of -1
>
> Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
> ---
>   mm/mempolicy.c |   10 +++++-----
>   1 files changed, 5 insertions(+), 5 deletions(-)

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

Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/mempolicy: use NUMA_NO_NODE
  2013-09-16 12:53 [PATCH] mm/mempolicy: use NUMA_NO_NODE Jianguo Wu
  2013-09-16 16:19 ` KOSAKI Motohiro
@ 2013-09-16 20:26 ` Cody P Schafer
  2013-09-17  1:00   ` Jianguo Wu
  1 sibling, 1 reply; 5+ messages in thread
From: Cody P Schafer @ 2013-09-16 20:26 UTC (permalink / raw)
  To: Jianguo Wu
  Cc: Andrew Morton, Mel Gorman, David Rientjes, KOSAKI Motohiro,
	Rik van Riel, Hugh Dickins, linux-mm, linux-kernel


> @@ -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/

>    */
>   int node_random(const nodemask_t *maskp)
>   {
> -	int w, bit = -1;
> +	int w, bit = NUMA_NO_NODE;
>
>   	w = nodes_weight(*maskp);
>   	if (w)
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/mempolicy: use NUMA_NO_NODE
  2013-09-16 16:19 ` KOSAKI Motohiro
@ 2013-09-17  0:59   ` Jianguo Wu
  0 siblings, 0 replies; 5+ messages in thread
From: Jianguo Wu @ 2013-09-17  0:59 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Andrew Morton, Mel Gorman, David Rientjes, KOSAKI Motohiro,
	Rik van Riel, Hugh Dickins, linux-mm, linux-kernel

On 2013/9/17 0:19, KOSAKI Motohiro wrote:

> (9/16/13 8:53 AM), Jianguo Wu wrote:
>> Use more appropriate NUMA_NO_NODE instead of -1
>>
>> Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
>> ---
>>   mm/mempolicy.c |   10 +++++-----
>>   1 files changed, 5 insertions(+), 5 deletions(-)
> 
> I think this patch don't make any functional change, right?
> 

Yes.

> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

Thanks for your ack.

> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/mempolicy: use NUMA_NO_NODE
  2013-09-16 20:26 ` Cody P Schafer
@ 2013-09-17  1:00   ` Jianguo Wu
  0 siblings, 0 replies; 5+ messages in thread
From: Jianguo Wu @ 2013-09-17  1:00 UTC (permalink / raw)
  To: Cody P Schafer
  Cc: Andrew Morton, Mel Gorman, David Rientjes, KOSAKI Motohiro,
	Rik van Riel, Hugh Dickins, linux-mm, linux-kernel

On 2013/9/17 4:26, Cody P Schafer wrote:

> 
>> @@ -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.

>>    */
>>   int node_random(const nodemask_t *maskp)
>>   {
>> -    int w, bit = -1;
>> +    int w, bit = NUMA_NO_NODE;
>>
>>       w = nodes_weight(*maskp);
>>       if (w)
>>
> 
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-17  1:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-16 12:53 [PATCH] mm/mempolicy: use NUMA_NO_NODE Jianguo Wu
2013-09-16 16:19 ` KOSAKI Motohiro
2013-09-17  0:59   ` Jianguo Wu
2013-09-16 20:26 ` Cody P Schafer
2013-09-17  1:00   ` Jianguo Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).