lkml.org 
[lkml]   [2012]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH -mm] do_migrate_pages() calls migrate_to_node() even if task is already on a correct node
On 03/22/2012 03:30 PM, Christoph Lameter wrote:
> On Thu, 22 Mar 2012, Larry Woodman wrote:
>
>>> Application may manage their locality given a range of nodes and each of
>>> the x .. x+n nodes has their particular purpose.
>> So to be clear on this, in that case the intention would be move 3 to 4, 4 to
>> 5 and 5 to 6
>> to keep the node ordering the same?
> Yup. Have a look at do_migrate_pages and the descrition in the comment by
> there by Paul Jackson.
>
>
Christoph and others what do you think about this???


diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 47296fe..6c189fa 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1012,6 +1012,16 @@ int do_migrate_pages(struct mm_struct *mm,
int dest = 0;

for_each_node_mask(s, tmp) {
+
+ /* IFF there is an equal number of source and
+ * destination nodes, maintain relative node distance
+ * even when source and destination nodes overlap.
+ * However, when the node weight is unequal, never move
+ * memory out of any destination nodes */
+ if ((nodes_weight(*from_nodes) != nodes_weight(*to_nodes)) &&
+ (node_isset(s, *to_nodes)))
+ continue;
+
d = node_remap(s, *from_nodes, *to_nodes);
if (s == d)
continue;
\
 
 \ /
  Last update: 2012-03-29 20:03    [W:0.101 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site