Re: kswap spinning

From: Rik van Riel (riel@conectiva.com.br)
Date: Mon Aug 20 2001 - 22:36:04 EST


On Mon, 20 Aug 2001, Marcelo Tosatti wrote:

> > Could you please boot with profile=2 and use readprofile to find out where
> > kswapd is spending its time?
>
> Well, I've just noted Linus made kswapd loop as long as there is any
> kind (inactive or free) shortage.

Well, duh. Let me explain.

>From mm/vmscan.c::kswapd() a short comment I wrote while
implementing part of the current VM:

                /*
                 * We go to sleep if either the free page shortage
                 * or the inactive page shortage is gone. We do this
                 * because:
                 * 1) we need no more free pages or
                 * 2) the inactive pages need to be flushed to disk,
                 * it wouldn't help to eat CPU time now ...
                 *
                 * We go to sleep for one second, but if it's needed
                 * we'll be woken up earlier...
                 */
                if (!free_shortage() || !inactive_shortage()) {
                        interruptible_sleep_on_timeout(&kswapd_wait, HZ);

I wonder when Linus lost his ability to read comments ;)

regards,

Rik

--
IA64: a worthy successor to i860.

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

Send all your spam to aardvark@nl.linux.org (spam digging piggy)

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



This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 21:00:39 EST