linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* swapoff throttling and speedup?
@ 2009-06-03 17:01 Joel Krauska
  2009-06-04  2:04 ` KAMEZAWA Hiroyuki
  2009-06-04 15:50 ` Hugh Dickins
  0 siblings, 2 replies; 6+ messages in thread
From: Joel Krauska @ 2009-06-03 17:01 UTC (permalink / raw)
  To: linux-mm

On occasion we need to unswap a system that's gotten unruly.

Scenario: Some leaky app eats up way more RAM than it should, and pushes
a few gigs of the running system in to swap.  The leaky app is killed, 
but there's still lots of good stuff sitting in swap that we need to tidy
up to get the system back to normal performance levels.


The normal recourse is to run
 swapoff -a ; swapon -a


I have two related questions about the swap tools and how they work.


1. Has anyone tried making a nicer swapoff?
Right now swapoff can be pretty aggressive if the system is otherwise
heavily loaded.  On systems that I need to leave running other jobs,
swapoff compounds the slowness of the system overall by burning up
a single CPU and lots of IO

I wrote a perl wrapper that briefly runs swapoff 
and then kills it, but it would seem more reasonable to have a knob
to make swapoff less aggressive. (max kb/s, etc)  

It looked to me like the swapoff code was immediately hitting kernel 
internals instead of doing more lifting itself (and making it 
obvious where I could insert some sleeps)

Has anyone found better options here?



2. A faster(multithreaded?) swapoff?
>From what I can tell, swapoff is single threaded, which seems to make 
unswapping a CPU bound activity.  

In the opposite use case of my first question, on systems that I /can/
halt all the running code (assuming if they've gone off the deep end and have
several gigs in SWAP) it can take quite a long time for unswap to 
tidy up the mess.  

Has anyone considered improvements to swapoff to speed it up?
(multiple threads?)


I'm hoping others have been down this road before.

As a rule, we try to avoid swapping when possible, but using:
vm.swappiness = 1

But it does still happen on occasion and that lead to this mail.

Cheers,

Joel

--
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:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2009-06-04 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-03 17:01 swapoff throttling and speedup? Joel Krauska
2009-06-04  2:04 ` KAMEZAWA Hiroyuki
2009-06-04  2:43   ` Joel Krauska
2009-06-04  2:54     ` KAMEZAWA Hiroyuki
2009-06-04 15:50 ` Hugh Dickins
2009-06-04 16:25   ` KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox