Re: Very aggressive swapping after 2 hours rest

From: Rik van Riel (riel@conectiva.com.br)
Date: Sat Sep 16 2000 - 12:36:15 EST


On Sat, 16 Sep 2000, Byron Stanoszek wrote:

> Active pages increased to 18688kB, and we see some inact_clean.
> Is this normal as intended?

Yes. There are 2 things going on during that find.

1) find touches buffers all over the place, those
   buffers will be added to the active list
2) kflushd will try to keep the number of inactive
   dirty pages smaller than or equal to the number
   of inactive clean and free pages

In this case it means that memory is slowly filled
with the buffers find loads into memory, into the
active list. At the same time, the amount of free
memory decreases and kflushd balances the amount of
inactive_dirty pages to a sane value...

> total: used: free: shared: buffers: cached:
> Mem: 129552384 101093376 28459008 0 17039360 36040704
> Swap: 32894976 0 32894976
> MemTotal: 126516 kB
> MemFree: 27792 kB
> MemShared: 0 kB
> Buffers: 16640 kB
> Cached: 35196 kB

> Active: 3128 kB
> Inact_dirty: 35704 kB
> Inact_clean: 13004 kB
> Inact_target: 20 kB

> Number of active pages decreased to 3 meg. Ok. So, what value
> should I use to determine what actually is in-use by processes.
> Obviously, 'free' doesn't give the correct results anymore. :)

OK, let me explain something about these numbers.
(I'll write better documentation around Linux Kongress)

MemFree: memory on the freelist, contains no data
Buffers: buffer cache memory
Cached: page cache memory

Active: buffer or page cache memory which is in active
              use (that is, page->age > 0 or many references)
Inact_dirty: buffer or cache pages with page->age == 0 that
              /might/ be freeable
              (page->buffers is set or page->count == 2 when
              we add the page ... while holding a reference)
Inact_clean: page cache pages with page->age == 0 of which
              we are /certain/ that they are freeable, these
              are counted almost as free pages
Inact_target: the net amount of allocations we get per second,
              averaged over one minute

We try to keep the following goals:

1) nr_free_pages() + nr_inactive_clean_pages() > freepages.high
2) nr_free_pages() + nr_inactive_clean_pages() + nr_inactive_dirty_pages
> freepages.high + inactive_target
3) nr_inactive_dirty_pages < nr_free_pages() + nr_inactive_clean_pages()

Goals #1 and #2 are kept by kswapd, while kflushd mostly takes
care of goal #3.

These 3 goals together make sure that VM performance is smooth
under most circumstances.

regards,

Rik

--
"What you're running that piece of shit Gnome?!?!"
       -- Miguel de Icaza, UKUUG 2000

http://www.conectiva.com/ http://www.surriel.com/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 21:00:13 EST