linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* reduce shrink_mmap rate of failure (initial attempt)
@ 2000-06-06 23:49 Roger Larsson
  2000-06-07  3:01 ` Quintela Carreira Juan J.
  2000-06-07 13:22 ` Zlatko Calusic
  0 siblings, 2 replies; 6+ messages in thread
From: Roger Larsson @ 2000-06-06 23:49 UTC (permalink / raw)
  To: Alan Cox, linux-mm, Zlatko Calusic

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

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/

[-- Attachment #2: patch-filemap --]
[-- Type: text/plain, Size: 870 bytes --]

--- /usr/src/linux/mm/filemap.c.orig	Sat Jun  3 19:09:16 2000
+++ /usr/src/linux/mm/filemap.c	Wed Jun  7 01:21:19 2000
@@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: reduce shrink_mmap rate of failure (initial attempt)
@ 2000-06-07 14:04 Roger Larsson
  2000-06-07 14:35 ` Rik van Riel
  2000-06-08  0:04 ` Roger Larsson
  0 siblings, 2 replies; 6+ messages in thread
From: Roger Larsson @ 2000-06-07 14:04 UTC (permalink / raw)
  To: 'quintela@fi.udc.es'; +Cc: 'linux-mm@kvack.org'

>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.


Ouch...

The only possible explaination is that we are searching for pages on a zone.
But no such pages are possible to free from LRU...
And we LOOP the list, holding the lru lock...
Note: without this patch you may end up in another bad situation where
shrink_mmap always fails and swapping will start until it swaps out a page
of that specific zone.
And without the test? We would free all other LRU pages without finding one
that we want :-(

This will be interesting to fix...

May the allocation of pages play a part? Filling zone after zone will give no
mix between the zones.

/RogerL
(from work)

--
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.eu.org/Linux-MM/

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

end of thread, other threads:[~2000-06-08  0:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-06 23:49 reduce shrink_mmap rate of failure (initial attempt) Roger Larsson
2000-06-07  3:01 ` Quintela Carreira Juan J.
2000-06-07 13:22 ` Zlatko Calusic
2000-06-07 14:04 Roger Larsson
2000-06-07 14:35 ` Rik van Riel
2000-06-08  0:04 ` Roger Larsson

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