Re: swapping and the value of /proc/sys/vm/swappiness

From: Nick Piggin
Date: Tue Sep 28 2004 - 19:37:43 EST




Nick Piggin wrote:


Thanks Ray. From looking over your old results, it appears that -kswapdfix
probably has the nicest swappiness ramp, which is probably to be expected,
as the problem that is being fixed did exist in all other kernels you tested,
but the later ones just had other aggrivating changes.

The swappiness=60 weirdness might just be some obscure interaction with the
workload. If that is the case, it is probably not too important, however it
could be due to a possible oversight in my patch....


Here is a patch on top of the last one - if you can give it a test
some time, that would be great.

Thanks
Nick




---

linux-2.6-npiggin/mm/vmscan.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diff -puN mm/vmscan.c~vm-no-wild-kswapd2 mm/vmscan.c
--- linux-2.6/mm/vmscan.c~vm-no-wild-kswapd2 2004-09-29 10:30:49.000000000 +1000
+++ linux-2.6-npiggin/mm/vmscan.c 2004-09-29 10:34:00.000000000 +1000
@@ -991,6 +991,7 @@ out:
static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
{
int to_free = nr_pages;
+ int all_zones_ok;
int priority;
int i;
int total_scanned, total_reclaimed;
@@ -1013,10 +1014,11 @@ loop_again:
}

for (priority = DEF_PRIORITY; priority >= 0; priority--) {
- int all_zones_ok = 1;
int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */
unsigned long lru_pages = 0;

+ all_zones_ok = 1;
+
if (nr_pages == 0) {
/*
* Scan in the highmem->dma direction for the highest
@@ -1106,7 +1108,7 @@ scan:
* on zone->*_priority.
*/
if (total_reclaimed >= SWAP_CLUSTER_MAX)
- goto loop_again;
+ break;
}
out:
for (i = 0; i < pgdat->nr_zones; i++) {
@@ -1114,6 +1116,9 @@ out:

zone->prev_priority = zone->temp_priority;
}
+ if (!all_zones_ok)
+ goto loop_again;
+
return total_reclaimed;
}


_