summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-08 18:54:49 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-08 18:54:49 +0000
commit5514f4babeeb3af00ee0c325e3cda7a562cc3d65 (patch)
treeedd733879cab73e41324a99ca5da7bc154c4196d /mm/vmscan.c
parent6a9366db547e958e8c9bf8e1c13bcea6cb2bf393 (diff)
Merge with Linux 2.4.0-test6-pre4.
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index cbdd0cb7f..4dda15dd1 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -444,20 +444,24 @@ static inline int memory_pressure(void)
*/
static inline int keep_kswapd_awake(void)
{
+ int all_recent = 1;
pg_data_t *pgdat = pgdat_list;
do {
int i;
for(i = 0; i < MAX_NR_ZONES; i++) {
zone_t *zone = pgdat->node_zones+ i;
- if (zone->size &&
- !zone->zone_wake_kswapd)
- return 0;
+ if (zone->size) {
+ if (zone->free_pages < zone->pages_min)
+ return 1;
+ if (!zone->zone_wake_kswapd)
+ all_recent = 0;
+ }
}
pgdat = pgdat->node_next;
} while (pgdat);
- return 1;
+ return all_recent;
}
/*
@@ -470,6 +474,9 @@ static inline int keep_kswapd_awake(void)
*
* Don't try _too_ hard, though. We don't want to have bad
* latency.
+ *
+ * Note: only called by kswapd and try_to_free_pages
+ * both can WAIT at top level.
*/
#define FREE_COUNT 8
#define SWAP_COUNT 16
@@ -548,7 +555,7 @@ static int do_try_to_free_pages(unsigned int gfp_mask)
}
/* Return 1 if any page is freed, or
* there are no more memory pressure */
- return (count < FREE_COUNT || !memory_pressure());
+ return (count < FREE_COUNT || !keep_kswapd_awake());
done:
return 1;