Re: [PATCH 1/2] sched/uclamp: Add a new sysctl to control RT default boost value
From: Qais Yousef
Date: Fri Jun 05 2020 - 06:58:47 EST
On 06/04/20 14:40, Mel Gorman wrote:
> > > > The diffs are smaller than on openSUSE Leap 15.1 and some of the
> > > > uclamp taskgroup results are better?
> > > >
> > >
> > > I don't see the stddev and coeff but these look close to borderline.
> > > Sure, they are marked with a * so it passed a significant test but it's
> > > still a very marginal difference for netperf. It's possible that the
> > > systemd configurations differ in some way that is significant for uclamp
> > > but I don't know what that is.
> >
> > Hmm so what you're saying is that Dietmar didn't reproduce the same problem
> > you're observing? I was hoping to use that to dig more into it.
> >
>
> Not as such, I'm saying that for whatever reason the problem is not as
> visible with Dietmar's setup. It may be machine-specific or distribution
> specific. There are alternative suggestions for testing just the fast
> paths with a pipe test that may be clearer.
Unfortunately lost access to that machine, but will resume testing on it as
soon as it's back online.
Vincent shared more info about his setup. If I can see the same thing without
having to use a big machine that'd make it easier to debug.
> > >
> > > > With this test setup we now can play with the uclamp code in
> > > > enqueue_task() and dequeue_task().
> > > >
> > >
> > > That is still true. An annotated perf profile should tell you if the
> > > uclamp code is being heavily used or if it's bailing early but it's also
> > > possible that uclamp overhead is not a big deal on your particular
> > > machine.
> > >
> > > The possibility that either the distribution, the machine or both are
> > > critical for detecting a problem with uclamp may explain why any overhead
> > > was missed. Even if it is marginal, it still makes sense to minimise the
> > > amount of uclamp code that is executed if no limit is specified for tasks.
> >
> > So one speculation I have that might be causing the problem is that the
> > accesses of struct uclamp_rq are causing bad cache behavior in your case. Your
> > mmtest description of the netperf says that it is sensitive to cacheline
> > bouncing.
> >
> > Looking at struct rq, the uclamp_rq is spanning 2 cachelines
> >
> > 29954 /* --- cacheline 1 boundary (64 bytes) --- */
> > 29955 struct uclamp_rq uclamp[2]; /* 64 96 */
> > 29956 /* --- cacheline 2 boundary (128 bytes) was 32 bytes ago --- */
> > 29957 unsigned int uclamp_flags; /* 160 4 */
> > 29958
> > 29959 /* XXX 28 bytes hole, try to pack */
> > 29960
> >
> > Reducing sturct uclamp_bucket to use unsigned int instead of unsigned long
> > helps putting it all in a single cacheline
> >
>
> I tried this and while it did not make much of a difference to the
> headline metric, the workload was less variable so if it's proven that
> cache line bouncing is reduced (I didn't measure it), it may have merit
> on its own even if it does not fully address the problem.
Yeah maybe if we can prove it's worth it. I'll keep it on my list to look at
after we fix the main issue first.
Thanks
--
Qais Yousef