lkml.org 
[lkml]   [2001]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: set_page_dirty/page_launder deadlock

Marcelo Tosatti writes:
>
> While taking a look at page_launder()...

...

> set_page_dirty() may lock the pagecache_lock which means potential
> deadlock since we have the pagemap_lru_lock locked.

Indeed, the following should work as a fix:

--- mm/vmscan.c.~1~ Thu Jan 11 02:22:19 2001
+++ mm/vmscan.c Sun Jan 14 05:26:17 2001
@@ -493,12 +493,15 @@
page_cache_release(page);

/* And re-start the thing.. */
- spin_lock(&pagemap_lru_lock);
- if (result != 1)
+ if (result != 1) {
+ spin_lock(&pagemap_lru_lock);
continue;
- /* writepage refused to do anything */
- set_page_dirty(page);
- goto page_active;
+ } else {
+ /* writepage refused to do anything */
+ set_page_dirty(page);
+ spin_lock(&pagemap_lru_lock);
+ goto page_active;
+ }
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.091 / U:3.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site