lkml.org 
[lkml]   [2014]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: lock_task_sighand() && rcu_boost()
On 05/05, Paul E. McKenney wrote:
>
> Does the patch below cover it?

Yes, thanks.

Acked-by: Oleg Nesterov <oleg@redhat.com>

> signal: Explain local_irq_save() call
>
> The explicit local_irq_save() in __lock_task_sighand() is needed to avoid
> a potential deadlock condition, as noted in a841796f11c90d53 (signal:
> align __lock_task_sighand() irq disabling and RCU). However, someone
> reading the code might be forgiven for concluding that this separate
> local_irq_save() was completely unnecessary. This commit therefore adds
> a comment referencing the shiny new block comment on rcu_read_unlock().
>
> Reported-by: Oleg Nesterov <oleg@redhat.com>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> diff --git a/kernel/signal.c b/kernel/signal.c
> index 6ea13c09ae56..513e8c252aa4 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1288,6 +1288,10 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
> struct sighand_struct *sighand;
>
> for (;;) {
> + /*
> + * Disable interrupts early to avoid deadlocks.
> + * See rcu_read_unlock comment header for details.
> + */
> local_irq_save(*flags);
> rcu_read_lock();
> sighand = rcu_dereference(tsk->sighand);
>



\
 
 \ /
  Last update: 2014-05-05 19:01    [W:0.095 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site