Skip to contentSkip to conversation

de_thread: don't take tasklist_lock

PATCH In review Oleg Nesterov 1 participant 1 message Feb 22, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 de_thread: don't take tasklist_lock

de_thread() takes tasklist_lock for zap_other_threads(), this is unneeded now.

fs/exec.c renamed from fs/exec.c~4_DET +0 -3
@@ -604,7 +604,6 @@ static int de_thread(struct task_struct 
 	 * Kill all other threads in the thread group.
 	 * We must hold tasklist_lock to call zap_other_threads.
 	 */
-	read_lock(&tasklist_lock);
 	spin_lock_irq(lock);
 	if (sig->flags & SIGNAL_GROUP_EXIT) {
 		/*
@@ -612,12 +611,10 @@ static int de_thread(struct task_struct 
 		 * return so that the signal is processed.
 		 */
 		spin_unlock_irq(lock);
-		read_unlock(&tasklist_lock);
 		kmem_cache_free(sighand_cachep, newsighand);
 		return -EAGAIN;
 	}
 	zap_other_threads(current);
-	read_unlock(&tasklist_lock);
 
 	/*
 	 * Account for the thread group leader hanging around: