linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Honglei Wang <wanghonglei@didichuxing.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	linux-kernel@vger.kernel.org,
	Huaixin Chang <changhuaixin@linux.alibaba.com>,
	Honglei Wang <jameshongleiwang@126.com>
Subject: Re: [PATCH v2 2/3] sched/fair: prevent cpu burst too many periods
Date: Thu, 9 Dec 2021 14:08:56 +0100	[thread overview]
Message-ID: <YbH/6H+QtjFlw+19@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20211208145038.64738-1-wanghonglei@didichuxing.com>

On Wed, Dec 08, 2021 at 10:50:38PM +0800, Honglei Wang wrote:
> Tasks might get more cpu than quota in persistent periods due to the
> cpu burst introduced by commit f4183717b370 ("sched/fair: Introduce the
> burstable CFS controller").

> For example, one task group whose quota is
> 100ms per period and can get 100ms burst, and its avg utilization is
> around 105ms per period.

That would be a mis-configuration, surely..

> Once this group gets a free period which
> leaves enough runtime, it has a chance to get computting power more
> than its quota for 10 periods or more in common bandwidth configuration
> (say, 100ms as period).

Sure, if it, for some miraculous reason, decides to sleep for a whole
period and then resume, it can indeed consume up to that 100ms extra,
which, if as per the above, done at 5ms per perios, would be 20 periods
until depleted.

> It means tasks can 'steal' the bursted power to
> do daily jobs because all tasks could be scheduled out or sleep to help
> the group get free periods.

That's the design,,

> I believe the purpose of cpu burst is to help handling bursty worklod.
> But if one task group can get computting power more than its quota for
> persistent periods even there is no bursty workload, it's kinda broke.

So if that was were bursty, it could consume that 100ms extra in a
single go and that would be fine, but spreading that same amount over 20
periods is somehow a problem? -- even though the interference is less.

> This patch limits the burst to 2 periods so that it won't break the
> quota limit for long. Permitting 2 periods can help on the scenario that
> periods refresh lands in the middle of a burst workload. With this, we
> can give task group more cpu burst power to handle the real burst
> workload and don't worry about the 'stealing'.

I've yet so see an actual reason for any of this...

  reply	other threads:[~2021-12-09 13:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 14:50 [PATCH v2 2/3] sched/fair: prevent cpu burst too many periods Honglei Wang
2021-12-09 13:08 ` Peter Zijlstra [this message]
2021-12-10 16:34   ` Honglei Wang

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=YbH/6H+QtjFlw+19@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=changhuaixin@linux.alibaba.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jameshongleiwang@126.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=wanghonglei@didichuxing.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).