From: Peter Zijlstra <peterz@infradead.org>
To: Liangyan <liangyan.peng@linux.alibaba.com>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
yun.wang@linux.alibaba.com, shanpeic@linux.alibaba.com,
xlpang@linux.alibaba.com,
"liangyan.ply" <liangyan.ply@linux.alibaba.com>,
Ben Segall <bsegall@google.com>
Subject: Re: [PATCH] sched/fair: don't restart enqueued cfs quota slack timer
Date: Mon, 3 Jun 2019 11:49:05 +0200 [thread overview]
Message-ID: <20190603094905.GA3419@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190603044309.168065-1-liangyan.peng@linux.alibaba.com>
On Mon, Jun 03, 2019 at 12:43:09PM +0800, Liangyan wrote:
> From: "liangyan.ply" <liangyan.ply@linux.alibaba.com>
>
> start_cfs_slack_bandwidth() will restart the quota slack timer,
> if it is called frequently, this timer will be restarted continuously
> and may have no chance to expire to unthrottle cfs tasks.
> This will cause that the throttled tasks can't be unthrottled in time
> although they have remaining quota.
This looks very similar to the patch from Ben here:
https://lkml.kernel.org/r/xm26blzlyr9d.fsf@bsegall-linux.svl.corp.google.com
>
> Signed-off-by: Liangyan <liangyan.peng@linux.alibaba.com>
> ---
> kernel/sched/fair.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index d90a64620072..fdb03c752f97 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4411,9 +4411,11 @@ static void start_cfs_slack_bandwidth(struct cfs_bandwidth *cfs_b)
> if (runtime_refresh_within(cfs_b, min_left))
> return;
>
> - hrtimer_start(&cfs_b->slack_timer,
> + if (!hrtimer_active(&cfs_b->slack_timer)) {
> + hrtimer_start(&cfs_b->slack_timer,
> ns_to_ktime(cfs_bandwidth_slack_period),
> HRTIMER_MODE_REL);
> + }
> }
>
> /* we know any runtime found here is valid as update_curr() precedes return */
> --
> 2.14.4.44.g2045bb6
>
next prev parent reply other threads:[~2019-06-03 9:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-03 4:43 Liangyan
2019-06-03 9:49 ` Peter Zijlstra [this message]
2019-06-03 20:23 ` bsegall
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=20190603094905.GA3419@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=liangyan.peng@linux.alibaba.com \
--cc=liangyan.ply@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=shanpeic@linux.alibaba.com \
--cc=xlpang@linux.alibaba.com \
--cc=yun.wang@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
Powered by JetHome