lkml.org 
[lkml]   [1999]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] highmem-2.3.25-A0

On Mon, 1 Nov 1999, Andrea Arcangeli wrote:

> dirty = size_buffers_type[BUF_DIRTY] >> PAGE_SHIFT;
> - tot = nr_lru_pages + nr_free_pages + nr_free_highpages;
> + tot = nr_lru_pages + nr_free_pages - nr_free_highpages;
> hard_dirty_limit = tot * bdf_prm.b_un.nfract / 100;
> soft_dirty_limit = hard_dirty_limit >> 1;

additionally high memory pages were accounted for incorrectly in the page
allocator as well, i've attached the fixes (against final-2.3.25). It's
important to balance only 'normal memory', at least now.

Ingo
--- linux/mm/page_alloc.c.orig Tue Nov 2 00:08:28 1999
+++ linux/mm/page_alloc.c Tue Nov 2 00:48:02 1999
@@ -262,11 +262,11 @@
}
low_on_highmemory = 1;
} else {
- if (nr_free_pages+nr_free_highpages > freepages.min) {
+ if (nr_free_pages-nr_free_highpages > freepages.min) {
if (!low_on_memory) {
return 1;
}
- if (nr_free_pages+nr_free_highpages >= freepages.high) {
+ if (nr_free_pages-nr_free_highpages >= freepages.high) {
low_on_memory = 0;
return 1;
}
@@ -320,6 +320,10 @@
do {
page = rmqueue(order, type);
if (page) {
+#ifdef CONFIG_HIGHMEM
+ if (type == MEM_TYPE_HIGH)
+ nr_free_highpages -= 1 << order;
+#endif
spin_unlock_irqrestore(&page_alloc_lock, flags);
return page;
}
\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.348 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site