Skip to contentSkip to conversation

__exit_signal: don't take rcu lock

PATCH New Oleg Nesterov 1 participant 1 message May 31, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 __exit_signal: don't take rcu lock

There is no reason for rcu_read_lock() in __exit_signal(). tsk->sighand can only be changed if tsk does exec, obviously this is not possible.

kernel/exit.c renamed from kernel/exit.c~0_ES_NO_RCU +0 -2
@@ -84,7 +84,6 @@ static void __exit_signal(struct task_st
 	BUG_ON(!sig);
 	BUG_ON(!atomic_read(&sig->count));
 
-	rcu_read_lock();
 	sighand = rcu_dereference(tsk->sighand);
 	spin_lock(&sighand->siglock);
 
@@ -135,7 +134,6 @@ static void __exit_signal(struct task_st
 	tsk->signal = NULL;
 	tsk->sighand = NULL;
 	spin_unlock(&sighand->siglock);
-	rcu_read_unlock();
 
 	__cleanup_sighand(sighand);
 	clear_tsk_thread_flag(tsk,TIF_SIGPENDING);