linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] simplify audit_free() locking
@ 2006-02-01 10:39 Ingo Molnar
  0 siblings, 0 replies; only message in thread
From: Ingo Molnar @ 2006-02-01 10:39 UTC (permalink / raw)
  To: dwmw2; +Cc: linux-kernel, Andrew Morton


this patch simplifies audit_free()'s locking: no need to lock a task 
that we are tearing down. [the extra locking also caused false positives 
in the lock validator]

Signed-off-by: Ingo Molnar <mingo@elte.hu>

Index: linux/kernel/auditsc.c
===================================================================
--- linux.orig/kernel/auditsc.c
+++ linux/kernel/auditsc.c
@@ -692,10 +692,14 @@ void audit_free(struct task_struct *tsk)
 {
 	struct audit_context *context;
 
-	task_lock(tsk);
+	/*
+	 * No need to lock the task - when we execute audit_free()
+	 * then the task has no external references anymore, and
+	 * we are tearing it down. (The locking also confuses
+	 * DEBUG_LOCKDEP - this freeing may occur in softirq
+	 * contexts as well, via RCU.)
+	 */
 	context = audit_get_context(tsk, 0, 0);
-	task_unlock(tsk);
-
 	if (likely(!context))
 		return;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-01 10:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-01 10:39 [patch] simplify audit_free() locking Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).