lkml.org 
[lkml]   [2005]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 01/13] mm: restore sc.nr_to_reclaim
Keep it before the real fine grained scan patch is ready :)

The following patches really needs small scan quantities, at least in
normal situation.

Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
---

mm/vmscan.c | 8 ++++++++
1 files changed, 8 insertions(+)

--- linux-2.6.15-rc5-mm1.orig/mm/vmscan.c
+++ linux-2.6.15-rc5-mm1/mm/vmscan.c
@@ -63,6 +63,9 @@ struct scan_control {

unsigned long nr_mapped; /* From page_state */

+ /* How many pages shrink_cache() should reclaim */
+ int nr_to_reclaim;
+
/* Ask shrink_caches, or shrink_zone to scan at this priority */
unsigned int priority;

@@ -898,6 +901,7 @@ static void shrink_cache(struct zone *zo
if (current_is_kswapd())
mod_page_state(kswapd_steal, nr_freed);
mod_page_state_zone(zone, pgsteal, nr_freed);
+ sc->nr_to_reclaim -= nr_freed;

spin_lock_irq(&zone->lru_lock);
/*
@@ -1097,6 +1101,8 @@ shrink_zone(struct zone *zone, struct sc
else
nr_inactive = 0;

+ sc->nr_to_reclaim = sc->swap_cluster_max;
+
while (nr_active || nr_inactive) {
if (nr_active) {
sc->nr_to_scan = min(nr_active,
@@ -1110,6 +1116,8 @@ shrink_zone(struct zone *zone, struct sc
(unsigned long)sc->swap_cluster_max);
nr_inactive -= sc->nr_to_scan;
shrink_cache(zone, sc);
+ if (sc->nr_to_reclaim <= 0)
+ break;
}
}

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-06 14:37    [W:0.042 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site