login
Header Space

 
 

Re: deadlock on 2.6.24.3-rt3

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Peter Zijlstra <peterz@...>
Cc: Steven Rostedt <rostedt@...>, linux-rt-users <linux-rt-users@...>, Ingo Molnar <mingo@...>, Thomas Gleixner <tglx@...>, LKML <linux-kernel@...>
Date: Thursday, March 20, 2008 - 4:31 pm

Hiroshi Shimamoto wrote:

Is this valid fix?

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 581afee..6fbc77e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -366,6 +366,7 @@ int remove_exclusive_swap_page(struct page *page)
 	/* Is the only swap cache user the cache itself? */
 	retval = 0;
 	if (p->swap_map[swp_offset(entry)] == 1) {
+		spin_unlock(&swap_lock);
 		/* Recheck the page count with the swapcache lock held.. */
 		lock_page_ref_irq(page);
 		if ((page_count(page) == 2) && !PageWriteback(page)) {
@@ -374,8 +375,8 @@ int remove_exclusive_swap_page(struct page *page)
 			retval = 1;
 		}
 		unlock_page_ref_irq(page);
-	}
-	spin_unlock(&swap_lock);
+	} else
+		spin_unlock(&swap_lock);
 
 	if (retval) {
 		swap_free(entry);


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: deadlock on 2.6.24.3-rt3, Steven Rostedt, (Mon Mar 17, 9:53 pm)
Re: deadlock on 2.6.24.3-rt3, Peter Zijlstra, (Tue Mar 18, 5:40 am)
[PATCH -rt] avoid deadlock related with PG_nonewrefs and swa..., Hiroshi Shimamoto, (Mon Mar 24, 2:24 pm)
Re: deadlock on 2.6.24.3-rt3, Hiroshi Shimamoto, (Tue Mar 18, 1:15 pm)
Re: deadlock on 2.6.24.3-rt3, Hiroshi Shimamoto, (Thu Mar 20, 4:31 pm)
speck-geostationary