Skip to contentSkip to conversation

reduce shrink_mmap rate of failure (initial attempt)

PATCH Roger Larsson 3 participants 3 messages Jun 6, 2000 – Jun 7, 2000

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

This is a trivial first attempt to reduce shrink_mmap failures (leading to swap)

It is against 2.4.0-test1-ac7-riel3 but that is almost what we have currently - and it is trivial to apply with an editor.

It might be possible to improve this further - but it is a start. (Time for bed...)

/RogerL

--
Home page:
http://www.norran.net/nra02596/

usr/src/linux/mm/filemap.c renamed from usr/src/linux/mm/filemap.c.orig +8 -7
@@ -332,6 +332,14 @@
 		if (page->age)
 			goto dispose_continue;
 
+		/*
+		 * Page is from a zone we don't care about.
+		 * Don't drop page cache entries in vain.
+		 * Must be done before count - or do a count++
+		 */
+		if (page->zone->free_pages > page->zone->pages_high)
+			goto dispose_continue;
+
 		count--;
 		/*
 		 * Avoid unscalable SMP locking for pages we can
@@ -367,13 +375,6 @@
 				goto made_buffer_progress;
 			}
 		}
-
-		/*
-		 * Page is from a zone we don't care about.
-		 * Don't drop page cache entries in vain.
-		 */
-		if (page->zone->free_pages > page->zone->pages_high)
-			goto unlock_continue;
 
 		/* Take the pagecache_lock spinlock held to avoid
 		   other tasks to notice the page while we are looking at its
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"roger" == Roger Larsson <[email protected]> writes:

Hi

roger> This is a trivial first attempt to reduce shrink_mmap failures roger> (leading to swap)

roger> It is against 2.4.0-test1-ac7-riel3 but that is almost what roger> we have currently - and it is trivial to apply with an editor.

roger> It might be possible to improve this further - but it is a start.

That patch hangs my machine here when I run mmap002. The machine is in shrink_mmap. It hangs trying to get the pagmap_lru_lock.

I think that the idea is good, but it doesn't work here :(.

Later, Juan.

Signature · 6 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
#2 lore raw
In reply to Roger Larsson
Quoted 11 lines · Roger Larsson

Hi all,

This is a trivial first attempt to reduce shrink_mmap failures (leading to swap)

It is against 2.4.0-test1-ac7-riel3 but that is almost what we have currently - and it is trivial to apply with an editor.

It might be possible to improve this further - but it is a start. (Time for bed...)

Very nice idea, but...

I tried exactly that a week or two ago and it was freezing the system like Juan noted (under heavy I/O loads). That's very unfortunate because it is my opinion too that shrink_mmap() fails too easily and falls back to swapping when it really shouldn't do that.

Regards,

Signature · 5 lines
Zlatko
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/