linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Memory Management <linux-mm@kvack.org>
Subject: [PATCH] 2/4: highmem watermarks
Date: Fri, 06 Aug 2004 14:57:54 +1000	[thread overview]
Message-ID: <41130FD2.5070608@yahoo.com.au> (raw)
In-Reply-To: <41130FB1.5020001@yahoo.com.au>

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

2/4

[-- Attachment #2: vm-highmem-watermarks.patch --]
[-- Type: text/x-patch, Size: 2335 bytes --]



The pages_high - pages_low and pages_low - pages_min deltas are the asynch
reclaim watermarks. As such, the should be in the same ratios as any other
zone for highmem zones. It is the pages_min - 0 delta which is the PF_MEMALLOC
reserve, and this is the region that isn't very useful for highmem.

This patch ensures highmem systems have similar characteristics as non highmem
ones with the same amount of memory, and also that highmem zones get similar
reclaim pressures to other zones.

Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>


---

 linux-2.6-npiggin/mm/page_alloc.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff -puN mm/page_alloc.c~vm-highmem-watermarks mm/page_alloc.c
--- linux-2.6/mm/page_alloc.c~vm-highmem-watermarks	2004-08-06 14:44:29.000000000 +1000
+++ linux-2.6-npiggin/mm/page_alloc.c	2004-08-06 14:44:29.000000000 +1000
@@ -1882,13 +1882,18 @@ static void setup_per_zone_pages_min(voi
 	}
 
 	for_each_zone(zone) {
+		unsigned long tmp;
 		spin_lock_irqsave(&zone->lru_lock, flags);
+		tmp = (pages_min * zone->present_pages) / lowmem_pages;
 		if (is_highmem(zone)) {
 			/*
-			 * Often, highmem doesn't need to reserve any pages.
-			 * But the pages_min/low/high values are also used for
-			 * batching up page reclaim activity so we need a
-			 * decent value here.
+			 * __GFP_HIGH and PF_MEMALLOC allocations usually don't
+			 * need highmem pages, so cap pages_min to a small
+			 * value here.
+			 *
+			 * The (pages_high-pages_low) and (pages_low-pages_min)
+			 * deltas controls asynch page reclaim, and so should
+			 * not be capped for highmem.
 			 */
 			int min_pages;
 
@@ -1899,15 +1904,15 @@ static void setup_per_zone_pages_min(voi
 				min_pages = 128;
 			zone->pages_min = min_pages;
 		} else {
-			/* if it's a lowmem zone, reserve a number of pages 
+			/*
+			 * If it's a lowmem zone, reserve a number of pages
 			 * proportionate to the zone's size.
 			 */
-			zone->pages_min = (pages_min * zone->present_pages) / 
-			                   lowmem_pages;
+			zone->pages_min = tmp;
 		}
 
-		zone->pages_low = zone->pages_min * 2;
-		zone->pages_high = zone->pages_min * 3;
+		zone->pages_low = zone->pages_min + tmp;
+		zone->pages_high = zone->pages_low + tmp;
 		spin_unlock_irqrestore(&zone->lru_lock, flags);
 	}
 }

_

  reply	other threads:[~2004-08-06  4:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-06  4:57 [PATCH] 1/4: rework alloc_pages Nick Piggin
2004-08-06  4:57 ` Nick Piggin [this message]
2004-08-06  5:03   ` [PATCH] 3/4: writeout watermarks Nick Piggin
2004-08-06  5:04     ` [PATCH] 4/4: incremental min aware kswapd Nick Piggin
2004-08-06  5:27     ` [PATCH] 3/4: writeout watermarks Andrew Morton
2004-08-06  5:34       ` Nick Piggin
2004-08-06  5:49         ` Andrew Morton
2004-08-06  6:13           ` Nick Piggin
2004-08-06  6:19             ` Andrew Morton
2004-08-06  6:36               ` Nick Piggin
2004-08-06  5:12 ` [PATCH] 1/4: rework alloc_pages Nick Piggin
2004-08-06  5:19 ` Andrew Morton
2004-08-06  5:29   ` Nick Piggin
2004-08-06  5:37     ` Andrew Morton
2004-08-06  6:05       ` Nick Piggin
2004-08-06  6:17         ` Andrew Morton
2004-08-06 12:01         ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41130FD2.5070608@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox