From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, Ben Segall <bsegall@google.com>,
Roman Gushchin <klamm@yandex-team.ru>
Subject: Re: [PATCH RFC] sched/fair: fix sudden expiration of cfq quota in put_prev_task()
Date: Tue, 07 Apr 2015 18:32:47 +0300 [thread overview]
Message-ID: <5523F89F.1070502@yandex-team.ru> (raw)
In-Reply-To: <20150407151246.GS24151@twins.programming.kicks-ass.net>
On 07.04.2015 18:12, Peter Zijlstra wrote:
> On Tue, Apr 07, 2015 at 03:47:58PM +0200, Peter Zijlstra wrote:
>> Lemme think a bit more on that.
>
> So going by 734ff2a71f9e ("sched/rt: Fix picking RT and DL tasks from
> empty queue") something like this would be called for.
>
> ---
> kernel/sched/fair.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index fdae26eb7218..1e47f816c976 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5175,6 +5175,21 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev)
> return p;
> simple:
> cfs_rq = &rq->cfs;
We don't need this if prev isn't from fair_sched_class:
first "goto simple" should go directly to "if (!cfs_rq->nr_running)".
> +
> + if (cfs_bandwidth_used()) {
> + /*
> + * We may dequeue prev's cfs_rq in put_prev_task().
> + * So, we update time before cfs_rq->nr_running check.
> + */
> + if (prev->on_rq)
> + update_curr(cfs_rq);
> +
> + se = &prev->se;
> + for_each_sched_entity(se) {
Probably update_curr() should be inside loop too?
> + cfs_rq = cfs_rq_of(se);
> + check_cfs_rq_runtime(cfs_rq);
> + }
> + }
> #endif
>
> if (!cfs_rq->nr_running)
>
--
Konstantin
next prev parent reply other threads:[~2015-04-07 15:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-03 12:41 Konstantin Khlebnikov
2015-04-03 12:51 ` Konstantin Khlebnikov
2015-04-07 12:52 ` Peter Zijlstra
2015-04-07 13:47 ` Peter Zijlstra
2015-04-07 15:12 ` Peter Zijlstra
2015-04-07 15:32 ` Konstantin Khlebnikov [this message]
2015-04-07 15:43 ` Peter Zijlstra
2015-04-06 22:45 ` bsegall
2015-04-07 15:53 ` Konstantin Khlebnikov
2015-06-07 17:47 ` [tip:sched/core] sched/fair: Prevent throttling in early pick_next_task_fair() tip-bot for Ben Segall
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=5523F89F.1070502@yandex-team.ru \
--to=khlebnikov@yandex-team.ru \
--cc=bsegall@google.com \
--cc=klamm@yandex-team.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/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