public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] fix for hang on rmmod
@ 2000-11-08  2:46 David Mosberger
  0 siblings, 0 replies; only message in thread
From: David Mosberger @ 2000-11-08  2:46 UTC (permalink / raw)
  To: linux-ia64

Here is a patch that should fix the problem with "rmmod" hanging.
I don't use modules much, but I tried Stephane's test case and
rmmod seems to work fine on it.

Thanks to Asit for tracking this down.

	--david

--- arch/ia64/kernel/unwind.c~	Wed Nov  1 22:49:13 2000
+++ arch/ia64/kernel/unwind.c	Tue Nov  7 18:16:43 2000
@@ -2025,32 +2025,26 @@
 			return;
 		}
 		prevt->next = table->next;
+	}
+	spin_unlock_irqrestore(&unw.lock, flags);
 
-		/* next, remove hash table entries for this table */
+	/* next, remove hash table entries for this table */
 
-		for (index = 0; index <= UNW_HASH_SIZE; ++index) {
-			if (unw.hash[index] >= UNW_CACHE_SIZE)
-				continue;
+	for (index = 0; index <= UNW_HASH_SIZE; ++index) {
+		tmp = unw.cache + unw.hash[index];
+		if (unw.hash[index] >= UNW_CACHE_SIZE
+		    || tmp->ip < table->start || tmp->ip >= table->end)
+			continue;
 
-			tmp = unw.cache + unw.hash[index];
-			prev = 0;
-			while (1) {
-				write_lock(&tmp->lock);
-				{
-					if (tmp->ip >= table->start && tmp->ip < table->end) {
-						if (prev)
-							prev->coll_chain = tmp->coll_chain;
-						else
-							unw.hash[index] = -1;
-						tmp->ip = 0;
-					} else
-						prev = tmp;
-				}
-				write_unlock(&tmp->lock);
+		write_lock(&tmp->lock);
+		{
+			if (tmp->ip >= table->start && tmp->ip < table->end) {
+				unw.hash[index] = tmp->coll_chain;
+				tmp->ip = 0;
 			}
 		}
+		write_unlock(&tmp->lock);
 	}
-	spin_unlock_irqrestore(&unw.lock, flags);
 
 	kfree(table);
 }


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

only message in thread, other threads:[~2000-11-08  2:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-08  2:46 [Linux-ia64] fix for hang on rmmod David Mosberger

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