public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@parallels.com>
To: Juri Lelli <juri.lelli@arm.com>
Cc: <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	Juri Lelli <juri.lelli@gmail.com>
Subject: Re: [PATCH 2/2] sched/deadline: always enqueue on previous rq when dl_task_timer fires
Date: Mon, 23 Mar 2015 12:09:07 +0300	[thread overview]
Message-ID: <1427101747.18720.7.camel@tkhai> (raw)
In-Reply-To: <1424770115-25343-2-git-send-email-juri.lelli@arm.com>

В Вт, 24/02/2015 в 09:28 +0000, Juri Lelli пишет:
> dl_task_timer() may fire on a different rq from where a task was removed
> after throttling. Since the call path is:
> 
>   dl_task_timer() ->
>     enqueue_task_dl() ->
>       enqueue_dl_entity() ->
>         replenish_dl_entity()
> 
> and replenish_dl_entity() uses dl_se's rq, we can't use current's rq
> in dl_task_timer(), but we need to lock the task's previous one.
> 
> Signed-off-by: Juri Lelli <juri.lelli@arm.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Kirill Tkhai <ktkhai@parallels.com>
> Cc: Juri Lelli <juri.lelli@gmail.com>
> Cc: linux-kernel@vger.kernel.org
> Fixes: 3960c8c0c789 ("sched: Make dl_task_time() use task_rq_lock()")

Acked-by: Kirill Tkhai <ktkhai@parallels.com>

3960c8c0c789 is already in Linus's tree, so this is a candidate for 4.0 too.

> ---
>  kernel/sched/deadline.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index dbf12a9..519e468 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -538,7 +538,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
>  	unsigned long flags;
>  	struct rq *rq;
>  
> -	rq = task_rq_lock(current, &flags);
> +	rq = task_rq_lock(p, &flags);
>  
>  	/*
>  	 * We need to take care of several possible races here:
> @@ -593,7 +593,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
>  		push_dl_task(rq);
>  #endif
>  unlock:
> -	task_rq_unlock(rq, current, &flags);
> +	task_rq_unlock(rq, p, &flags);
>  
>  	return HRTIMER_NORESTART;
>  }

Thanks,
Kirill


      parent reply	other threads:[~2015-03-23  9:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24  9:28 [PATCH 1/2] sched/deadline,core: fix bandwidth update when changing cpuset cpumask Juri Lelli
2015-02-24  9:28 ` [PATCH 2/2] sched/deadline: always enqueue on previous rq when dl_task_timer fires Juri Lelli
2015-02-26  0:43   ` Wanpeng Li
2015-03-23  9:09   ` Kirill Tkhai [this message]

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=1427101747.18720.7.camel@tkhai \
    --to=ktkhai@parallels.com \
    --cc=juri.lelli@arm.com \
    --cc=juri.lelli@gmail.com \
    --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