linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFT][PATCH] even out background aging
@ 2001-06-15 15:17 Rik van Riel
  2001-06-15 16:21 ` Mike Galbraith
  0 siblings, 1 reply; 2+ messages in thread
From: Rik van Riel @ 2001-06-15 15:17 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel

[Request For Testers:  please test this on your system...]

Hi,

the following patch makes use of the fact that refill_inactive()
now calls swap_out() before calling refill_inactive_scan() and
the fact that the inactive_dirty list is now reclaimed in a fair
LRU order.

Background scanning can now be replaced by a simple call to
refill_inactive(), instead of the refill_inactive_scan(), which
gave mapped pages an unfair advantage over unmapped ones.

The special-casing of the amount to scan in refill_inactive_scan()
is removed as well, there's absolutely no reason we'd need it with
the current VM balance.

regards,

Rik
--


--- linux-2.4.6-pre3/mm/vmscan.c.orig	Thu Jun 14 12:28:03 2001
+++ linux-2.4.6-pre3/mm/vmscan.c	Fri Jun 15 11:55:09 2001
@@ -695,13 +695,6 @@
 	int page_active = 0;
 	int nr_deactivated = 0;

-	/*
-	 * When we are background aging, we try to increase the page aging
-	 * information in the system.
-	 */
-	if (!target)
-		maxscan = nr_active_pages >> 4;
-
 	/* Take the lock while messing with the list... */
 	spin_lock(&pagemap_lru_lock);
 	while (maxscan-- > 0 && (page_lru = active_list.prev) != &active_list) {
@@ -978,7 +971,7 @@
 			recalculate_vm_stats();

 			/* Do background page aging. */
-			refill_inactive_scan(DEF_PRIORITY, 0);
+			refill_inactive(GFP_KSWAPD, 0);
 		}

 		run_task_queue(&tq_disk);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFT][PATCH] even out background aging
  2001-06-15 15:17 [RFT][PATCH] even out background aging Rik van Riel
@ 2001-06-15 16:21 ` Mike Galbraith
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Galbraith @ 2001-06-15 16:21 UTC (permalink / raw)
  To: Rik van Riel; +Cc: linux-kernel

On Fri, 15 Jun 2001, Rik van Riel wrote:

> [Request For Testers:  please test this on your system...]
>
> Hi,
>
> the following patch makes use of the fact that refill_inactive()
> now calls swap_out() before calling refill_inactive_scan() and
> the fact that the inactive_dirty list is now reclaimed in a fair
> LRU order.
>
> Background scanning can now be replaced by a simple call to
> refill_inactive(), instead of the refill_inactive_scan(), which
> gave mapped pages an unfair advantage over unmapped ones.

Hi Rik,

While I was testing this suggestion (still actually) prior to your
RFT, the first thing I did was the straight substitution, but under
heavy load, the additional swap/aging when there is a ~persistant
shortage hurt ~fairly badly.  What I did instead, and shows no ill
effects under any load I've tried so far was...

		/* If needed, try to free some memory. */
		if (inactive_shortage() || free_shortage())
			do_try_to_free_pages(GFP_KSWAPD, 0);
		else {
			/* Do background page aging. */
			swap_out(DEF_PRIORITY, GFP_KSWAPD);
			refill_inactive_scan(DEF_PRIORITY, 0);
		}

I still had the benefit of idle pages being pushed to disk quickly
and staying there :)  IMHO, this is the first real candidate for a
sysctl tunable, as it's possibly not good for everyone.  As indicated
privately, I like the effect of this suggestion a lot, but laptop
people may not because of the infrequent and miniscule swapin (which
_might_ be an irritant _if_ they are doing enough work etc etc).

	-Mike

(this report would have landed in your mailbox tomorrow.. I was too
slow.  sending it to lkml lest someone sees the same high load thing
I did and determine it's a loss unfairly)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-06-15 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-15 15:17 [RFT][PATCH] even out background aging Rik van Riel
2001-06-15 16:21 ` Mike Galbraith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).