All of lore.kernel.org
 help / color / mirror / Atom feed
* vmscan.c heuristic adjustment for smaller systems
@ 2004-04-17 19:38 William Lee Irwin III
  2004-04-17 21:29 ` Marc Singer
  0 siblings, 1 reply; 30+ messages in thread
From: William Lee Irwin III @ 2004-04-17 19:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, elf

Marc Singer reported an issue where an embedded ARM system performed
poorly due to page replacement potentially prematurely replacing
mapped memory where there was very little mapped pagecache in use to
begin with.

The following patch attempts to address the issue by using the
_maximum_ of vm_swappiness and distress to add to the mapped ratio, so
that distress doesn't contribute to swap_tendency until it exceeds
vm_swappiness, and afterward the effect is not cumulative.

The intended effect is that swap_tendency should vary in a more jagged
way, and not be elevated by distress beyond vm_swappiness until distress
exceeds vm_swappiness. For instance, since distress is 100 >>
zone->prev_priority, no distinction is made between a vm_swappiness of
50 or a vm_swappiness of 90 given the same mapped_ratio.

Marc Singer has results where this is an improvement, and hopefully can
clarify as-needed. Help determining whether this policy change is an
improvement for a broader variety of systems would be appreciated.


-- wli


Index: singer-2.6.5-mm6/mm/vmscan.c
===================================================================
--- singer-2.6.5-mm6.orig/mm/vmscan.c	2004-04-14 23:21:19.000000000 -0700
+++ singer-2.6.5-mm6/mm/vmscan.c	2004-04-17 11:09:35.000000000 -0700
@@ -636,7 +636,7 @@
 	 *
 	 * A 100% value of vm_swappiness overrides this algorithm altogether.
 	 */
-	swap_tendency = mapped_ratio / 2 + distress + vm_swappiness;
+	swap_tendency = mapped_ratio / 2 + max(distress, vm_swappiness);
 
 	/*
 	 * Now use this metric to decide whether to start moving mapped memory

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: vmscan.c heuristic adjustment for smaller systems
@ 2004-04-18 17:48 Marc Singer
  0 siblings, 0 replies; 30+ messages in thread
From: Marc Singer @ 2004-04-18 17:48 UTC (permalink / raw)
  To: linux-mm

> Might be worth reading my thread on linux-mm about this and commenting?
> (hint hint)

Did you start a thread about this?  I'm not seeing it.

On Sun, Apr 18, 2004 at 10:29:47AM +0100, Russell King wrote:
> On Sat, Apr 17, 2004 at 05:23:43PM -0700, Marc Singer wrote:
> > All of these tests are performed at the console, one command at a
> > time.  I have a telnet daemon available, so I open a second connection
> > to the target system.  I run a continuous loop of file copies on the
> > console and I execute 'ls -l /proc' in the telnet window.  It's a
> > little slow, but it isn't unreasonable.  Hmm.  I then run the copy
> > command in the telnet window followed by the 'ls -l /proc'.  It works
> > fine.  I logout of the console session and perform the telnet window
> > test again.  The 'ls -l /proc takes 30 seconds.
> > 
> > When there is more than one process running, everything is peachy.
> > When there is only one process (no context switching) I see the slow
> > performance.  I had a hypothesis, but my test of that hypothesis
> > failed.
> 
> Guys, this tends to indicate that we _must_ have up to date aging
> information from the PTE - if not, we're liable to miss out on the
> pressure from user applications.  The "lazy" method which 2.4 will
> allow is not possible with 2.6.
> 
> This means we must flush the TLB when we mark the PTE old.

That has been my hypothesis all along.  But I have failed to prove it
to myself.  Please steer me if I've missed your point about flushing
TLB entries when we age PTEs.

As you recall, I was originally concerned that clearing hardware PTEs
without flushing the related TLB entries was causing my crash.  You
corrected my misunderstanding and the then we found the real culprit.
However, we discussed whether or not it was desirable to always flush
TLBs when aging PTEs instead of being lazy about it as the kernel now
is.

So, I tried this.  Since I don't know the virtual address for a PTE in
the set_pte() routine, I changed it to flush the whole TLB whenever it
sets a hardware PTE entry to zero.  Yet, I still get the slow-down
behavior.  I also changed the TLB flush routines to always do a
complete TLB flush instead of flushing individual entries.  Still, no
change in the slow-down.

So, if my slow-down is related to lazy TLB flushing then I am at a
loss to explain how.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] 30+ messages in thread
[parent not found: <20040418174743.GC28744@flea>]

end of thread, other threads:[~2004-04-19  0:39 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-17 19:38 vmscan.c heuristic adjustment for smaller systems William Lee Irwin III
2004-04-17 21:29 ` Marc Singer
2004-04-17 21:33   ` William Lee Irwin III
2004-04-17 21:52     ` Marc Singer
2004-04-18  1:06       ` William Lee Irwin III
2004-04-18  5:05         ` Marc Singer
2004-04-17 23:21   ` Andrew Morton
2004-04-17 23:30     ` Marc Singer
2004-04-17 23:51       ` Andrew Morton
2004-04-18  0:11         ` Trond Myklebust
2004-04-18  0:23         ` Marc Singer
2004-04-18  3:37           ` Nick Piggin
2004-04-18  4:17             ` William Lee Irwin III
2004-04-18  4:41               ` Nick Piggin
2004-04-18  5:10                 ` Marc Singer
2004-04-18  5:19                   ` Nick Piggin
2004-04-18  5:35                     ` Marc Singer
2004-04-18  5:41                       ` Nick Piggin
2004-04-18 23:44                         ` Marc Singer
2004-04-18  9:29           ` Russell King
2004-04-18  1:59         ` William Lee Irwin III
2004-04-18  3:53           ` Andrew Morton
2004-04-18  5:38             ` Marc Singer
2004-04-18  5:52               ` Andrew Morton
2004-04-18  6:15                 ` Marc Singer
2004-04-19  0:26                   ` Rik van Riel
2004-04-19  0:39                     ` Marc Singer
  -- strict thread matches above, loose matches on Subject: below --
2004-04-18 17:48 Marc Singer
     [not found] <20040418174743.GC28744@flea>
     [not found] ` <20040418175324.GB743@holomorphy.com>
2004-04-18 18:06   ` Marc Singer
2004-04-18 19:05     ` William Lee Irwin III

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.