All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@gmail.com>
To: Kirill Tkhai <ktkhai@parallels.com>, linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@kernel.org, devel@openvz.org
Subject: Re: [PATCH v2 -tip] sched/deadline: switched_to_dl() -- skip if task is current
Date: Tue, 28 Jan 2014 11:38:22 +0100	[thread overview]
Message-ID: <52E7889E.9030706@gmail.com> (raw)
In-Reply-To: <20140128072421.32315.25300.stgit@tkhai>

On 01/28/2014 08:26 AM, Kirill Tkhai wrote:
> v2: Changed comment
> 
> When p is current and it's not of dl class, then there are no other
> dl taks in the rq. If we had had pushable tasks in some other rq,
       ^ tasks

> they would have been pushed earlier. So, skip "p == rq->curr" case.
> 
> [This is confirmed by Juri Lelli and LKML was CC'ed, but
>  unfotunately I can't find direct link on lkml.org]
> 

This was the story:

> On 01/08/2014 10:00 AM, Juri Lelli wrote:
>> On 12/18/2013 04:00 PM, Kirill Tkhai wrote:
>>> 17.12.2013, 16:48, "Peter Zijlstra" <peterz@infradead.org>:
>>> From: Dario Faggioli <raistlin@linux.it>
>>>
>>> Introduces the data structures, constants and symbols needed for
>>> SCHED_DEADLINE implementation.
>>
>> [snipped]
>>
>>> +static void switched_to_dl(struct rq *rq, struct task_struct *p)
>>> +{
>>> +	/*
>>> +	 * If p is throttled, don't consider the possibility
>>> +	 * of preempting rq->curr, the check will be done right
>>> +	 * after its runtime will get replenished.
>>> +	 */
>>> +	if (unlikely(p->dl.dl_throttled))
>>> +		return;
>>> +
>>> +	if (!p->on_rq || rq->curr != p) {
>>> +		if (task_has_dl_policy(rq->curr))
>>> +			check_preempt_curr_dl(rq, p, 0);
>>> +		else
>>> +			resched_task(rq->curr);
>>> +	}
>>> +}
>>
>> The second if() looks a little strange. Why is "!p->on_rq ||" here? RT class
>> has another logic.
>>
>
> You are right, good catch! :)
>
> This has to be changed in
>
>   if (p->on_rq && rq->curr != p)
>
> as in RT.
>
> Thanks,
>
> - Juri

> Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
> CC: Juri Lelli <juri.lelli@gmail.com>
> CC: Peter Zijlstra <peterz@infradead.org>
> CC: Ingo Molnar <mingo@kernel.org>
> ---
>  kernel/sched/deadline.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 0de2482..dd19d6d 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -1559,7 +1559,7 @@ static void switched_to_dl(struct rq *rq, struct task_struct *p)
>  	if (unlikely(p->dl.dl_throttled))
>  		return;
>  
> -	if (p->on_rq || rq->curr != p) {
> +	if (p->on_rq && rq->curr != p) {
>  #ifdef CONFIG_SMP
>  		if (rq->dl.overloaded && push_dl_task(rq) && rq != task_rq(p))
>  			/* Only reschedule if pushing failed */
> 

So the patch looks good. Not sure about the changelog, though :).

Thanks,

- Juri

  reply	other threads:[~2014-01-28 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28  7:26 [PATCH v2 -tip] sched/deadline: switched_to_dl() -- skip if task is current Kirill Tkhai
2014-01-28 10:38 ` Juri Lelli [this message]
2014-02-10 13:29 ` [tip:sched/core] sched/deadline: Skip in switched_to_dl() " tip-bot for Kirill Tkhai

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=52E7889E.9030706@gmail.com \
    --to=juri.lelli@gmail.com \
    --cc=devel@openvz.org \
    --cc=ktkhai@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.