Re: [LKP] [sched/fair] 6c8116c914: stress-ng.mmapfork.ops_per_sec -38.0% regression

From: Vincent Guittot
Date: Sat Apr 25 2020 - 04:43:47 EST


On Sat, 25 Apr 2020 at 03:23, Hillf Danton <hdanton@xxxxxxxx> wrote:
>
>
> Hi Xing
>
> On Fri, 24 Apr 2020 16:15:45 +0800 Xing Zhengjun wrote:
> >
> > Hi Tao,
> >
> > Do you have time to take a look at this? Thanks.
> >
> > On 4/21/2020 8:47 AM, kernel test robot wrote:
> > >
> > > Greeting,
> > >
> > > FYI, we noticed a 56.4% improvement of stress-ng.fifo.ops_per_sec due to commit:
> > >
> > >
> > > commit: 6c8116c914b65be5e4d6f66d69c8142eb0648c22 ("sched/fair: Fix condition of avg_load calculation")
> > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
> > >
> > > in testcase: stress-ng
> > > on test machine: 88 threads Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz with 128G memory
> > > with following parameters:
> > >
> > > nr_threads: 100%
> > > disk: 1HDD
> > > testtime: 1s
> > > class: scheduler
> > > cpufreq_governor: performance
> > > ucode: 0xb000038
> > > sc_pid_max: 4194304
> > >
>
> Here is a tiny workaround. If it makes a sense to you see if it helps
> cure the regression.
>
> Hillf
>
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8744,6 +8744,16 @@ find_idlest_group(struct sched_domain *s
>
> switch (local_sgs.group_type) {
> case group_overloaded:
> + /*
> + * push the task if it helps cut the imbalance in the
> + * number of running tasks
> + */
> + if (local_sgs.sum_h_nr_running >
> + idlest_sgs.sum_h_nr_running)
> + return idlest;
> + else
> + return NULL;

Taking into account nr_running when overloaded to bypass load
comparison just break the fairness and the spread of load and will
cause regression for other use cases



> +
> case group_fully_busy:
> /*
> * When comparing groups across NUMA domains, it's possible for
> --
>