linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] small rmap bugfix
@ 2002-07-11 20:08 Rik van Riel
  2002-07-11 20:18 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Rik van Riel @ 2002-07-11 20:08 UTC (permalink / raw)
  To: Andrew Morton; +Cc: William Lee Irwin III, linux-mm

Hi,

I just ran into a bad piece of code in the rmap patch Andrew
has been testing recently. It's possible for pages that were
truncated to still have their bufferheads _and_ be mapped in
the pagetables of processes.

In that case a piece of code in shrink_cache would remove
that page from the LRU ... in effect making it unswappable.

Since the lru_cache_del() is called from page_cache_release()
anyway we can fix the bug by dropping this obsolete piece of
code.

regards,

Rik
-- 
Bravely reimplemented by the knights who say "NIH".

http://www.surriel.com/		http://distro.conectiva.com/


===== mm/vmscan.c 1.81 vs edited =====
--- 1.81/mm/vmscan.c	Fri Jul  5 22:31:52 2002
+++ edited/mm/vmscan.c	Thu Jul 11 17:01:00 2002
@@ -235,19 +235,11 @@

 			if (try_to_release_page(page, gfp_mask)) {
 				if (!mapping) {
-					/*
-					 * We must not allow an anon page
-					 * with no buffers to be visible on
-					 * the LRU, so we unlock the page after
-					 * taking the lru lock
-					 */
-					spin_lock(&pagemap_lru_lock);
-					unlock_page(page);
-					__lru_cache_del(page);
-
 					/* effectively free the page here */
+					unlock_page(page);
 					page_cache_release(page);

+					spin_lock(&pagemap_lru_lock);
 					if (--nr_pages)
 						continue;
 					break;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

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

end of thread, other threads:[~2002-07-11 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-11 20:08 [PATCH] small rmap bugfix Rik van Riel
2002-07-11 20:18 ` Andrew Morton

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