[PATCH] Write throttling should not take free highmem into account

Linux Kernel Mailing List <[email protected]> Fri, 11 Mar 2005 16:56:03 +0000
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1574, 2005/03/11 13:56:03-03:00, [email protected]

	[PATCH] Write throttling should not take free highmem into account
	
	I've got a fix for you on 2.4. I got reports of stalls with heavy writes
	on 2.4. There was a mistake in nr_free_buffer_pages. That function is
	definitely meant _not_ to take highmem into account (dirty cache cannot
	spread over highmem in 2.4 [even when on top of fs]). For unknown
	reasons it was actually taking highmem into account. The code was
	obviously meant to not take into account see the GFP_USER and zonelist,
	except it wasn't using the zonelist. That is a severe problem because
	there will be no write throttling at all, and no bdflush wakeup either.
	
	This should fix it, though my compiler fails to compile 2.4, so it's not
	immediate to verify it. If any problem showup I'll post a followup.
	
	This is a noop for all systems <800M (1G shouldn't be noticeable
	either). This is why most people can't notice.
	
	Signed-off-by: Andrea Arcangeli <[email protected]>



 page_alloc.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c	2005-03-11 14:01:48 -08:00
+++ b/mm/page_alloc.c	2005-03-11 14:01:48 -08:00
@@ -551,7 +551,7 @@
 		class_idx = zone_idx(zone);
 
 		sum += zone->nr_cache_pages;
-		for (zone = pgdat->node_zones; zone < pgdat->node_zones + MAX_NR_ZONES; zone++) {
+		for (; zone; zone = *zonep++) {
 			int free = zone->free_pages - zone->watermarks[class_idx].high;
 			if (free <= 0)
 				continue;