Skip to contentSkip to conversation

Fix the spurious unlock_cpu_hotplug false warnings.

PATCH New Gautham R Shenoy 1 participant 1 message Nov 3, 2006 CPU hotplug

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix the spurious unlock_cpu_hotplug false warnings.

Cpu-hotplug locking has a minor race case caused because of setting the variable "recursive" to NULL *after* releasing the cpu_bitmask_lock in the function unlock_cpu_hotplug,instead of doing so before releasing the cpu_bitmask_lock.

This was the cause of most of the recent false spurious lock_cpu_unlock warnings.

This should fix the problem reported by Martin Lorenz reported in
http://lkml.org/lkml/2006/10/29/127.

Thanks to Srinivasa DS for pointing it out.

--

 kernel/cpu.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
kernel/cpu.c +1 -1
Index: hotplug/kernel/cpu.c
===================================================================
@@ -58,8 +58,8 @@ void unlock_cpu_hotplug(void)
 		recursive_depth--;
 		return;
 	}
-	mutex_unlock(&cpu_bitmask_lock);
 	recursive = NULL;
+	mutex_unlock(&cpu_bitmask_lock);
 }
 EXPORT_SYMBOL_GPL(unlock_cpu_hotplug);
 
Signature · 5 lines
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"