linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* new kswapd logic
@ 1998-03-02 23:54 Rik van Riel
  1998-03-03  1:44 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Rik van Riel @ 1998-03-02 23:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Stephen C. Tweedie, linux-mm

Hi Linus,

with my new free_memory_available() patch, it
should be possible to put in my kswapd logic
patch again.

Besides, since my kswapd logic patch _does_
put a limit on the number of freed pages, and
the old mechanism doesn't, my algoritm should
(in theory) prevent the 'my machine just swapped
out 24 of 48 megs of memory' messages we've been
getting on linux-kernel this weekend.

Linus, I've been testing my new kswapd and
free_memory_available() patches, and they work
better than the original ones, so please put
them in...

Rik.
+-----------------------------+------------------------------+
| For Linux mm-patches, go to | "I'm busy managing memory.." |
| my homepage (via LinuxHQ).  | H.H.vanRiel@fys.ruu.nl       |
| ...submissions welcome...   | http://www.fys.ruu.nl/~riel/ |
+-----------------------------+------------------------------+

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

* Re: new kswapd logic
  1998-03-02 23:54 new kswapd logic Rik van Riel
@ 1998-03-03  1:44 ` Linus Torvalds
  1998-03-03  1:50   ` Rik van Riel
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 1998-03-03  1:44 UTC (permalink / raw)
  To: Rik van Riel; +Cc: Stephen C. Tweedie, linux-mm



On Tue, 3 Mar 1998, Rik van Riel wrote:
> 
> with my new free_memory_available() patch, it
> should be possible to put in my kswapd logic
> patch again.

Actually, I really think that the _correct_ fix is to make kswapd be a
very low-priority process that works in the background, rather than be a
very high-priority process that works in the foreground. 

Then we'd have some _really_ low watermark that occasionally makes it a
high-priority process, but the point is that right now the whole problem
is brought around not so much because we're low on memory, but due to
simple stupidity with kswapd hogging the whole machine even though it
shouldn't..

			Linus

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

* Re: new kswapd logic
  1998-03-03  1:44 ` Linus Torvalds
@ 1998-03-03  1:50   ` Rik van Riel
  0 siblings, 0 replies; 3+ messages in thread
From: Rik van Riel @ 1998-03-03  1:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Stephen C. Tweedie, linux-mm

On Mon, 2 Mar 1998, Linus Torvalds wrote:
> On Tue, 3 Mar 1998, Rik van Riel wrote:
> > 
> > with my new free_memory_available() patch, it
> > should be possible to put in my kswapd logic
> > patch again.
> 
> Actually, I really think that the _correct_ fix is to make kswapd be a
> very low-priority process that works in the background, rather than be a
> very high-priority process that works in the foreground. 

There's no problem with kswapd being high-priority...
It just shouldn't run for very long periods. We should:
- limit the amount of pages it can try to free
- make sure that it tries more and more as memory becomes
  more and more scarce
- make sure that kswapd doesn't hog resources when it isn't
  neccesary

The first two issues are solved with my patch (have any
of you guys tried it?) and the last one is only partly
adressed.

I will be studying this 'problem' RSN... Maybe kswapd
should limit itself to x% of CPU by keeping it's CPU
statistics around?
(ie. don't use more than 5% CPU over the last 30 seconds,
if memory is still absurdly low, and there's free swap,
just page out _everything_. If there's no free swap and
the page cache is minimal, we need to kill some program)

Rik.
+-----------------------------+------------------------------+
| For Linux mm-patches, go to | "I'm busy managing memory.." |
| my homepage (via LinuxHQ).  | H.H.vanRiel@fys.ruu.nl       |
| ...submissions welcome...   | http://www.fys.ruu.nl/~riel/ |
+-----------------------------+------------------------------+

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

end of thread, other threads:[~1998-03-03  1:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-02 23:54 new kswapd logic Rik van Riel
1998-03-03  1:44 ` Linus Torvalds
1998-03-03  1:50   ` Rik van Riel

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