linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Bellasi <patrick.bellasi@arm.com>
To: Aaron Lu <aaron.lu@intel.com>
Cc: "Ye, Xiaolong" <xiaolong.ye@intel.com>,
	Joel Fernandes <joelaf@google.com>,
	Juri Lelli <juri.lelli@redhat.com>, Todd Kjos <tkjos@android.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Peter Zijlstra <peterz@infradead.org>,
	Paul Turner <pjt@google.com>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steve Muckle <smuckle@google.com>, "lkp@01.org" <lkp@01.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Chris Redpath <chris.redpath@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [LKP] [lkp-robot] [sched/fair] d519329f72: unixbench.score -9.9% regression
Date: Thu, 25 Oct 2018 10:31:00 +0100	[thread overview]
Message-ID: <20181025093100.GB13236@e110439-lin> (raw)
In-Reply-To: <20181025085629.GA18146@intel.com>

On 25-Oct 16:56, Aaron Lu wrote:
> On Wed, Oct 24, 2018 at 06:01:37PM +0100, Patrick Bellasi wrote:
> > On 24-Oct 14:41, Aaron Lu wrote:
> > > On Mon, Apr 02, 2018 at 11:20:00AM +0800, Ye, Xiaolong wrote:
> > > > 
> > > > Greeting,
> > > > 
> > > > FYI, we noticed a -9.9% regression of unixbench.score due to commit:
> > > > 
> > > > 
> > > > commit: d519329f72a6f36bc4f2b85452640cfe583b4f81 ("sched/fair: Update util_est only on util_avg updates")
> > > > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
> > > > 
> > > > in testcase: unixbench
> > > > on test machine: 8 threads Intel(R) Core(TM) i7 CPU 870 @ 2.93GHz with 6G memory
> > > > with following parameters:
> > > > 
> > > >         runtime: 300s
> > > >         nr_task: 100%
> > > >         test: execl
> > > > 
> > > > test-description: UnixBench is the original BYTE UNIX benchmark suite aims to test performance of Unix-like system.
> > > > test-url: https://github.com/kdlucas/byte-unixbench
> > 
> > Hi Aaron,
> >  
> > > I tested this workload on different machines with this commit
> > > d519329f72a6f36bc4f2b85452 and its parent a07630b8b2c16f82, I also
> > > tested with v4.19-rc8 to see if the regression is gone -
> > > the performance drop is there with v4.19-rc8 and with different
> > > machines so I assume this regression is not solved yet.
> > >
> > > Here are detailed data:
> > > 
> > > cmdline used to run this workload:
> > > ./Run execl -c $nr_cpu -i 30
> > 
> > I had a better look into this issue and found that something like this
> > could be the cure for the execl throughput regression:
> 
> Good news, yes they are!

Great.

> > ---8<---
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 908c9cdae2f0..c34d41b542fc 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -6258,8 +6258,17 @@ static unsigned long cpu_util_wake(int cpu, struct task_struct *p)
> >  	 * covered by the following code when estimated utilization is
> >  	 * enabled.
> >  	 */
> > -	if (sched_feat(UTIL_EST))
> > -		util = max(util, READ_ONCE(cfs_rq->avg.util_est.enqueued));
> > +	if (sched_feat(UTIL_EST)) {
> > +		unsigned int estimated =
> > +			READ_ONCE(cfs_rq->avg.util_est.enqueued);
> > +
> > +		if (unlikely(current == p)) {
> > +			estimated -= min_t(unsigned int, estimated,
> > +				(_task_util_est(p) | UTIL_AVG_UNCHANGED));
> > +		}
> > +
> > +		util = max(util, estimated);
> > +	}
> > 
> >  	/*
> >  	 * Utilization (estimated) can exceed the CPU capacity, thus let's
> > ---8<---
> > 
> > I'll test this better on a machine on my side and send out a proper
> > patch by tomorrow.
> > 
> > > Please let me know if you need other information, thanks.
> > 
> > Would be nice if you can test the above on your side too.
> > 
> 
> commit cbcb74a95c5af32f9127a102feca323139ba2c49 is the commit I made
> from your diff and it restored performance for the two desktops. the
> result on the skylake server isn't quite stable so I think the
> performance gap is due to noise.
> 
> lkp-ivb-d04:
> cbcb74a95c5af32f9127a102feca323139ba2c49/avg.json:  "unixbench.score": 2946.0,
> d519329f72a6f36bc4f2b85452640cfe583b4f81/avg.json:  "unixbench.score": 2669.5333333333333,
> a07630b8b2c16f82fd5b71d890079f4dd7599c1d/avg.json:  "unixbench.score": 2924.3333333333335,
> 
> lkp-hsw-d01:
> cbcb74a95c5af32f9127a102feca323139ba2c49/avg.json:  "unixbench.score": 7013.533333333333,
> d519329f72a6f36bc4f2b85452640cfe583b4f81/avg.json:  "unixbench.score": 6421.233333333333,
> a07630b8b2c16f82fd5b71d890079f4dd7599c1d/avg.json:  "unixbench.score": 7090.400000000001,
> 
> lkp-skl-2sp2:
> cbcb74a95c5af32f9127a102feca323139ba2c49/avg.json:  "unixbench.score": 9347.02,
> d519329f72a6f36bc4f2b85452640cfe583b4f81/avg.json:  "unixbench.score": 9362.76,
> a07630b8b2c16f82fd5b71d890079f4dd7599c1d/avg.json:  "unixbench.score": 9520.86,

I've measured a ~15% speedup with the patch in wrt v4.19.0 on a
40 CPUs Intel(R) Xeon(R) CPU E5-2690 v2 @ 3.00GHz.

################################################################################
### Mainline (v4.19.0):

Benchmark Run: Wed Oct 24 2018 16:13:34 - 16:19:04
40 CPUs in system; running 40 parallel copies of tests

Execl Throughput                              48136.5 lps   (29.9 s, 7 samples)

System Benchmarks Partial Index              BASELINE       RESULT    INDEX
Execl Throughput                                 43.0      48136.5  11194.5
                                                                   ========
System Benchmarks Index Score (Partial Only)                        11194.5

################################################################################
### Mainline (v4.19.0) + patch:

Benchmark Run: Wed Oct 24 2018 16:29:56 - 16:35:26
40 CPUs in system; running 40 parallel copies of tests

Execl Throughput                              55373.6 lps   (29.9 s, 7 samples)

System Benchmarks Partial Index              BASELINE       RESULT    INDEX
Execl Throughput                                 43.0      55373.6  12877.6
                                                                   ========
System Benchmarks Index Score (Partial Only)                        12877.6

################################################################################

Thanks again reporting and testing on your side, I'll post soon a proper
patch.

Cheers Patrick

-- 
#include <best/regards.h>

Patrick Bellasi

      reply	other threads:[~2018-10-25  9:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02  3:20 [lkp-robot] [sched/fair] d519329f72: unixbench.score -9.9% regression kernel test robot
2018-04-03 11:43 ` Patrick Bellasi
2018-04-04  6:14   ` Ye Xiaolong
2018-10-24  6:41 ` [LKP] " Aaron Lu
2018-10-24 17:01   ` Patrick Bellasi
2018-10-25  8:56     ` Aaron Lu
2018-10-25  9:31       ` Patrick Bellasi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181025093100.GB13236@e110439-lin \
    --to=patrick.bellasi@arm.com \
    --cc=aaron.lu@intel.com \
    --cc=chris.redpath@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joelaf@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=mingo@kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sfr@canb.auug.org.au \
    --cc=smuckle@google.com \
    --cc=tglx@linutronix.de \
    --cc=tkjos@android.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viresh.kumar@linaro.org \
    --cc=xiaolong.ye@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).