[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtD8k-LMaXz_MNmxeW5aXDO4ZZ6j=gwCRTRU89OJ9nUEGw@mail.gmail.com>
Date: Thu, 13 Feb 2020 17:38:31 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Mel Gorman <mgorman@...hsingularity.net>
Cc: Phil Auld <pauld@...hat.com>, Hillf Danton <hdanton@...a.com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Parth Shah <parth@...ux.ibm.com>,
Valentin Schneider <valentin.schneider@....com>
Subject: Re: [RFC 2/4] sched/numa: replace runnable_load_avg by load_avg
On Thu, 13 Feb 2020 at 17:34, Mel Gorman <mgorman@...hsingularity.net> wrote:
>
> On Thu, Feb 13, 2020 at 05:11:23PM +0100, Vincent Guittot wrote:
> > > On Thu, Feb 13, 2020 at 10:00:26AM -0500, Phil Auld wrote:
> > > > On Thu, Feb 13, 2020 at 01:46:55PM +0000 Mel Gorman wrote:
> > > > > On Thu, Feb 13, 2020 at 09:16:58PM +0800, Hillf Danton wrote:
> > > > > > > - load = task_h_load(env->p);
> > > > > > > - dst_load = env->dst_stats.load + load;
> > > > > > > - src_load = env->src_stats.load - load;
> > > > > > > -
> > > > > > > /*
> > > > > > > - * If the improvement from just moving env->p direction is better
> > > > > > > - * than swapping tasks around, check if a move is possible.
> > > > > > > + * If dst node has spare capacity, then check if there is an
> > > > > > > + * imbalance that would be overruled by the load balancer.
> > > > > > > */
> > > > > > > - maymove = !load_too_imbalanced(src_load, dst_load, env);
> > > > > > > + if (env->dst_stats.node_type == node_has_spare) {
> > > > > > > + unsigned int imbalance;
> > > > > > > + int src_running, dst_running;
> > > > > > > +
> > > > > > > + /* Would movement cause an imbalance? */
> > > > > > > + src_running = env->src_stats.nr_running - 1;
> > > > > > > + dst_running = env->src_stats.nr_running + 1;
> > > > > > > + imbalance = max(0, dst_running - src_running);
> > > > > >
> > > > > > Have trouble working out why 2 is magician again to make your test data nicer :P
> > > > > >
> > > > >
> > > > > This is calculating what the nr_running would be after the move and
> > > > > checking if an imbalance exists after the move forcing the load balancer
> > > > > to intervene.
> > > >
> > > > Isn't that always going to work out to 2?
> > > >
> > >
> > > Crap, stupid cut and paste moving between source trees. Yes, this is
> > > broken.
> >
> > On the load balance side we have 2 rules when NUMA groups has spare capacity:
> > - ensure that the diff between src and dst nr_running < 2
> > - if src_nr_running is lower than 2, allow a degree of imbalance of 2
> > instead of 1
> >
> > Your test doesn't explicitly ensure that the 1 condition is met
> >
> > That being said, I'm not sure it's really a wrong thing ? I mean
> > load_balance will probably try to pull back some tasks on src but as
> > long as it is not a task with dst node as preferred node, it should
> > not be that harmfull
>
> My thinking was that if source has as many or more running tasks than
> the destination *after* the move that it's not harmful and does not add
> work for the load balancer.
load_balancer will see an imbalance but fbq_classify_group/queue
should be there to prevent from pulling back tasks that are on the
preferred node but only other tasks
>
> --
> Mel Gorman
> SUSE Labs
Powered by blists - more mailing lists