linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bsegall@google.com
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: Liangyan <liangyan.peng@linux.alibaba.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, shanpeic@linux.alibaba.com,
	xlpang@linux.alibaba.com
Subject: Re: [PATCH] sched/fair: don't assign runtime for throttled cfs_rq
Date: Mon, 26 Aug 2019 10:38:02 -0700	[thread overview]
Message-ID: <xm26k1azn7yd.fsf@bsegall-linux.svl.corp.google.com> (raw)
In-Reply-To: <942ae15c-ffa5-74da-208b-7e82df917e16@arm.com> (Valentin Schneider's message of "Sat, 24 Aug 2019 00:19:02 +0100")

Valentin Schneider <valentin.schneider@arm.com> writes:

> On 23/08/2019 21:00, bsegall@google.com wrote:
> [...]
>> Could you mention in the message that this a throttled cfs_rq can have
>> account_cfs_rq_runtime called on it because it is throttled before
>> idle_balance, and the idle_balance calls update_rq_clock to add time
>> that is accounted to the task.
>> 
>
> Mayhaps even a comment for the extra condition.
>
>> I think this solution is less risky than unthrottling
>> in this area, so other than that:
>> 
>> Reviewed-by: Ben Segall <bsegall@google.com>
>> 
>
> If you don't mind squashing this in:
>
> -----8<-----
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index b1d9cec9b1ed..b47b0bcf56bc 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4630,6 +4630,10 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b, u64 remaining)
>  		if (!cfs_rq_throttled(cfs_rq))
>  			goto next;
>  
> +		/* By the above check, this should never be true */
> +		WARN_ON(cfs_rq->runtime_remaining > 0);
> +
> +		/* Pick the minimum amount to return to a positive quota state */
>  		runtime = -cfs_rq->runtime_remaining + 1;
>  		if (runtime > remaining)
>  			runtime = remaining;
> ----->8-----
>
> I'm not adamant about the extra comment, but the WARN_ON would be nice IMO.
>
>
> @Ben, do you reckon we want to strap
>
> Cc: <stable@vger.kernel.org>
> Fixes: ec12cb7f31e2 ("sched: Accumulate per-cfs_rq cpu usage and charge against bandwidth")
>
> to the thing? AFAICT the pick_next_task_fair() + idle_balance() dance you
> described should still be possible on that commit.

I'm not sure about stable policy in general, but it seems reasonable.
The WARN_ON might want to be WARN_ON_ONCE, and it seems fine to have it
or not.

>
>
> Other than that,
>
> Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
>
> [...]

  reply	other threads:[~2019-08-26 17:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 18:00 [PATCH] sched/fair: don't assign runtime for throttled cfs_rq Liangyan
2019-08-15 16:36 ` Valentin Schneider
     [not found]   ` <7C1833A8-27A4-4755-9B1E-335C20207A66@linux.alibaba.com>
2019-08-16 14:02     ` Valentin Schneider
2019-08-16 14:31       ` Valentin Schneider
     [not found]         ` <02BC41EE-6653-4473-91D4-CDEE53D8703D@linux.alibaba.com>
2019-08-16 17:19           ` Valentin Schneider
2019-08-19 17:34             ` Valentin Schneider
2019-08-20 10:54               ` [PATCH] sched/fair: Add missing unthrottle_cfs_rq() Valentin Schneider
2019-08-22  9:21                 ` Peter Zijlstra
2019-08-22 17:43                   ` bsegall
2019-08-22 18:48                 ` bsegall
2019-08-22 20:40                   ` Valentin Schneider
2019-08-22 21:10                     ` Valentin Schneider
2019-08-23  7:22                   ` Liangyan
2019-08-23 20:00 ` [PATCH] sched/fair: don't assign runtime for throttled cfs_rq bsegall
2019-08-23 23:19   ` Valentin Schneider
2019-08-26 17:38     ` bsegall [this message]
2019-08-27  2:45       ` Liangyan

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=xm26k1azn7yd.fsf@bsegall-linux.svl.corp.google.com \
    --to=bsegall@google.com \
    --cc=liangyan.peng@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=shanpeic@linux.alibaba.com \
    --cc=valentin.schneider@arm.com \
    --cc=xlpang@linux.alibaba.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).