Skip to contentSkip to conversation

PATCH: Improvement in shrink_mmap

PATCH Juan J. Quintela 1 participant 2 messages Jun 14, 2000 – Jun 15, 2000

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

Hi
The actual code in shrink mmap waits for all the pages after we pass priority pages. The idea is to wait only each priority pages. I have had such a patch for a while here, it appears to work here. I send it to Linus in the middle of a bigger patch that was not accepted and I forgot to send only this two-liner.

Later, Juan.

mm/filemap.c +3 -1
diff -urN --exclude-from=/home/lfcia/quintela/work/kernel/exclude ac18/mm/filemap.c prueba/mm/filemap.c
@@ -351,7 +351,9 @@
 		 * of zone - it's old.
 		 */
 		if (page->buffers) {
-			int wait = ((gfp_mask & __GFP_IO) && (nr_dirty-- < 0));
+			int wait = ((gfp_mask & __GFP_IO) && (nr_dirty-- <= 0));
+			if(nr_dirty < 0)
+				nr_dirty = priority;
 			if (!try_to_free_buffers(page, wait))
 				goto unlock_continue;
 			/* page was locked, inode can't go away under us */
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/
#1 lore raw

Re: PATCH: Improvement in shrink_mmap (take 2)

Hi

James Manning told me that this test is easier to optimize (global result is the same).

Later, Juan.

mm/filemap.c +3 -1
diff -urN --exclude-from=/home/lfcia/quintela/work/kernel/exclude ac18/mm/filemap.c prueba/mm/filemap.c
@@ -351,7 +351,9 @@
 		 * of zone - it's old.
 		 */
 		if (page->buffers) {
-			int wait = ((gfp_mask & __GFP_IO) && (nr_dirty-- < 0));
+			int wait = ((gfp_mask & __GFP_IO) && (--nr_dirty < 0));
+			if(nr_dirty < 0)
+				nr_dirty = priority;
 			if (!try_to_free_buffers(page, wait))
 				goto unlock_continue;
 			/* page was locked, inode can't go away under us */
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/