linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch] Useless locking in mm/numa.c
@ 2002-07-19  1:03 Matthew Dobson
  2002-07-19 18:36 ` Kanoj Sarcar
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Dobson @ 2002-07-19  1:03 UTC (permalink / raw)
  To: Andrew Morton, Martin Bligh, linux-mm, Michael Hohnbaum

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

There is a lock that is apparently protecting nothing.  The node_lock spinlock 
in mm/numa.c is protecting read-only accesses to pgdat_list.  Here is a patch 
to get rid of it.

Cheers!

-Matt

[-- Attachment #2: node_lock.patch --]
[-- Type: text/plain, Size: 752 bytes --]

--- linux-2.5.26-vanilla/mm/numa.c	Tue Jul 16 16:49:30 2002
+++ linux-2.5.26-vanilla/mm/numa.c.fixed	Thu Jul 18 17:59:35 2002
@@ -44,15 +44,11 @@
 
 #define LONG_ALIGN(x) (((x)+(sizeof(long))-1)&~((sizeof(long))-1))
 
-static spinlock_t node_lock = SPIN_LOCK_UNLOCKED;
-
 void show_free_areas_node(pg_data_t *pgdat)
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&node_lock, flags);
 	show_free_areas_core(pgdat);
-	spin_unlock_irqrestore(&node_lock, flags);
 }
 
 /*
@@ -106,11 +102,9 @@
 #ifdef CONFIG_NUMA
 	temp = NODE_DATA(numa_node_id());
 #else
-	spin_lock_irqsave(&node_lock, flags);
 	if (!next) next = pgdat_list;
 	temp = next;
 	next = next->node_next;
-	spin_unlock_irqrestore(&node_lock, flags);
 #endif
 	start = temp;
 	while (temp) {

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-07-19 21:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-19  1:03 [patch] Useless locking in mm/numa.c Matthew Dobson
2002-07-19 18:36 ` Kanoj Sarcar
2002-07-19 18:38   ` William Lee Irwin III
2002-07-19 18:40     ` Kanoj Sarcar
2002-07-19 20:30   ` Matthew Dobson
2002-07-19 21:45     ` Matthew Dobson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox