lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1427101747.18720.7.camel@tkhai>
Date:	Mon, 23 Mar 2015 12:09:07 +0300
From:	Kirill Tkhai <ktkhai@...allels.com>
To:	Juri Lelli <juri.lelli@....com>
CC:	<linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...hat.com>,
	"Peter Zijlstra" <peterz@...radead.org>,
	Juri Lelli <juri.lelli@...il.com>
Subject: Re: [PATCH 2/2] sched/deadline: always enqueue on previous rq when
 dl_task_timer fires

В Вт, 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@....com>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Kirill Tkhai <ktkhai@...allels.com>
> Cc: Juri Lelli <juri.lelli@...il.com>
> Cc: linux-kernel@...r.kernel.org
> Fixes: 3960c8c0c789 ("sched: Make dl_task_time() use task_rq_lock()")

Acked-by: Kirill Tkhai <ktkhai@...allels.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ