From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932093AbbE1LH5 (ORCPT ); Thu, 28 May 2015 07:07:57 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:52476 "EHLO e28smtp03.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752201AbbE1LHt (ORCPT ); Thu, 28 May 2015 07:07:49 -0400 Date: Thu, 28 May 2015 16:37:41 +0530 From: Srikar Dronamraju To: riel@redhat.com Cc: linux-kernel@vger.kernel.org, mgorman@suse.de, jhladky@redhat.com, peterz@infradead.org, mingo@kernel.org, dedekind1@gmail.com Subject: Re: [PATCH 2/2] numa,sched: only consider less busy nodes as numa balancing destination Message-ID: <20150528110741.GA3370@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <1432753468-7785-1-git-send-email-riel@redhat.com> <1432753468-7785-3-git-send-email-riel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1432753468-7785-3-git-send-email-riel@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15052811-0009-0000-0000-000005B4C5BF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * riel@redhat.com [2015-05-27 15:04:28]: > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index c47bf0dffb34..f655f2ad155d 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -1398,6 +1398,30 @@ static void task_numa_find_cpu(struct task_numa_env *env, > } > } > > +/* Only move tasks to a NUMA node less busy than the current node. */ > +static bool numa_has_capacity(struct task_numa_env *env) > +{ > + struct numa_stats *src = &env->src_stats; > + struct numa_stats *dst = &env->dst_stats; > + > + if (src->has_free_capacity && !dst->has_free_capacity) > + return false; > + > + /* > + * Only consider a task move if the source has a higher destination > + * than the destination, corrected for CPU capacity on each node. In the above comment, did you mean source has higher load than the destination? > + * > + * src->load dst->load > + * --------------------- vs --------------------- > + * src->compute_capacity dst->compute_capacity > + */ > + if (src->load * dst->compute_capacity > > + dst->load * src->compute_capacity) > + return true; > + > + return false; > +} > + > -- Thanks and Regards Srikar Dronamraju