public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* How do I make this thing stop laging?  Reboot?  Sounds like  Windows!
@ 2003-06-18  0:30 rmoser
  2003-06-18  8:22 ` Helge Hafting
  0 siblings, 1 reply; 18+ messages in thread
From: rmoser @ 2003-06-18  0:30 UTC (permalink / raw)
  To: linux-kernel

Figured this one out.  I had the issue where xmms was skipping a
lot and my system was lagging wasy too much.  Rebooted to fix it
(WTF?!) whenever it happened.  Couldn't understand why.  Hard disk
light flashing, but no programs that read from the HDD all that much
(xmms doesn't do it THAT much).

I got rid of htdig.  It stopped.

So I ran GIMP recently and caused it again.  Clicked in the wrong
place and BOOM!  Gradient needs too much RAM and CPU and time.
Killed gimp.  Suddenly, my system is lagging.

Ten minutes later I get the brains to run top.  It seems I have about
50 MB in swap, and 54 MB free memory.  So I wait ten minutes more.

No change.

% swapoff -a; swapon -a

Fixes all my problems.

Now this long story shows something:  The kernel appears to be unable
to intelligently pull swap back into RAM.  What gives?

I'm poking around in linux/mm and can't find the code to control this.  I
want to make it swap back in any page that it reads, even if it has to
swap out another page (preferably one which hasn't been used for very
long).  Also, a more aggressive thing, kswapd should have freepages.max
in there, to force it to pull in pages from swap aggressively if there's a lot
of free RAM and a lot of swap used.

Uhh, I'm lost... how does this stuff work?  I'm... really lost.  Should I be
doing this?  Tell me where to start maybe?

--Bluefox Icy


^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: How do I make this thing stop laging?  Reboot?  Sounds like   Windows!
@ 2003-06-18  9:56 Karl Vogel
  2003-06-18 16:53 ` Oliver Neukum
  0 siblings, 1 reply; 18+ messages in thread
From: Karl Vogel @ 2003-06-18  9:56 UTC (permalink / raw)
  To: 'Oliver Neukum', linux-kernel

> > Swap prefetching? If you have >10% free physical ram and 
> any used swap it
> > will start swapping pages back into physical ram. Probably 
> not of real
> > benefit but many people like this idea. I have a soft spot 
> for it and like
> > using it.
> > --
> >
> > The disadvantage is ofcourse that you will be using up more 
> RAM than is
> > really necessary.
> 
> No, free RAM is wasted RAM.

But the point is, it's not really free RAM. It's being used for
I/O caching. So while swap prefetching might be suited for
desktop systems, it certainly isn't for servers.



^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: How do I make this thing stop laging?  Reboot?  Sounds like   Windows!
@ 2003-06-18 10:43 Karl Vogel
  0 siblings, 0 replies; 18+ messages in thread
From: Karl Vogel @ 2003-06-18 10:43 UTC (permalink / raw)
  To: 'Anders Karlsson'; +Cc: LKML

> Is it feasible to tweak the Linux VM to behave in the same fashion? If
> Linux already does it this way, I'll just shut up. :)

I think it's time to shut up :-)

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: How do I make this thing stop laging?  Reboot?  Sounds like   Windows!
@ 2003-06-18 10:49 Karl Vogel
  0 siblings, 0 replies; 18+ messages in thread
From: Karl Vogel @ 2003-06-18 10:49 UTC (permalink / raw)
  To: 'Anders Karlsson'; +Cc: LKML

> I find that the Linux VM tend to push things out in to swap-space when
> it does not need it. This is fine. However, I was once told something
> about AIX that has lodged itself in the back of my mind.
> 
> AIX uses (or used to use) the exact same way of reading/writing data
> from/to disk for all I/O. AIX also makes a distinction 
> between code and
> data. If code in RAM is unused, it simply gets flushed. If it 
> is needed
> again at a later time, it is paged in from disk where it was 
> originally
> loaded from. Only dirty data is paged out into swap.
> 
> Is it feasible to tweak the Linux VM to behave in the same fashion? If
> Linux already does it this way, I'll just shut up. :)

EUhm now a bit more constructive than my last reply (sorry, couldn't help
myself :)


Referring to Mel Gorman's excellent v2.4 kernel VM documentation:

Understanding The
Linux Virtual Memory Manager

"
12. Swap Management

Just as Linux uses free memory for purposes such as buffering data from
disk, there eventually is a need to free up private or anonymous pages used
by a process. These pages, unlike those backed by a file on disk, cannot be
simply discarded to be read in later. Instead they have to be carefully
copied to backing storage, sometimes called the swap area. This chapter
details how Linux uses and manages its backing storage.
"

http://www.csn.ul.ie/~mel/projects/vm/guide/html/understand/node73.html

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

end of thread, other threads:[~2003-06-19 15:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-18  0:30 How do I make this thing stop laging? Reboot? Sounds like Windows! rmoser
2003-06-18  8:22 ` Helge Hafting
2003-06-18  9:22   ` Karl Vogel
2003-06-18  9:44     ` Oliver Neukum
2003-06-18 10:23     ` Anders Karlsson
2003-06-18 15:08       ` Gianni Tedesco
2003-06-18 16:43     ` Joe
2003-06-18  9:30   ` Yaroslav Rastrigin
2003-06-18 11:02     ` Helge Hafting
2003-06-18 12:17       ` Mike Galbraith
2003-06-19  8:04   ` H. Peter Anvin
2003-06-19 10:00     ` Helge Hafting
2003-06-19 10:02       ` Nick Piggin
2003-06-19 15:54       ` Daniel Gryniewicz
  -- strict thread matches above, loose matches on Subject: below --
2003-06-18  9:56 Karl Vogel
2003-06-18 16:53 ` Oliver Neukum
2003-06-18 10:43 Karl Vogel
2003-06-18 10:49 Karl Vogel

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