From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756788AbbFPPA0 (ORCPT ); Tue, 16 Jun 2015 11:00:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34591 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753033AbbFPPAT (ORCPT ); Tue, 16 Jun 2015 11:00:19 -0400 Message-ID: <55803A02.6050204@redhat.com> Date: Tue, 16 Jun 2015 11:00:18 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Srikar Dronamraju , Ingo Molnar , Peter Zijlstra CC: linux-kernel@vger.kernel.org, Mel Gorman Subject: Re: [PATCH v2 4/4] sched:Use correct nid while evaluating task weights References: <1434455762-30857-1-git-send-email-srikar@linux.vnet.ibm.com> <1434455762-30857-5-git-send-email-srikar@linux.vnet.ibm.com> In-Reply-To: <1434455762-30857-5-git-send-email-srikar@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/16/2015 07:56 AM, Srikar Dronamraju wrote: > In task_numa_migrate(), while evaluating other nodes for group > consolidation, env.dst_nid is used instead of using the iterator nid. > Using env.dst_nid would mean dist is always the same. Infact the same > dist was calculated above while evaluating the preferred node. > > Fix the above to use the iterator nid. Good catch. > Also the task/group weights from the src_nid should be calculated > irrespective of numa topology type. If you look at score_nearby_nodes(), you will see that maxdist is only used when the topology is NUMA_BACKPLANE. The source score never changes when having a directly connected or NUMA_GLUELESS_MESH type system, so the source score does not need to be recalculated unless we are actually dealing with a NUMA_BACKPLANE topology. Looking forward to a v2 with just the first fix. > Signed-off-by: Srikar Dronamraju > --- > kernel/sched/fair.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index d1aa374..e1b3393 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -1493,9 +1493,8 @@ static int task_numa_migrate(struct task_struct *p) > if (nid == env.src_nid || nid == p->numa_preferred_nid) > continue; > > - dist = node_distance(env.src_nid, env.dst_nid); > - if (sched_numa_topology_type == NUMA_BACKPLANE && > - dist != env.dist) { > + dist = node_distance(env.src_nid, nid); > + if (dist != env.dist) { > taskweight = task_weight(p, env.src_nid, dist); > groupweight = group_weight(p, env.src_nid, dist); > } >