Re: VM: question

Stephen C. Tweedie (sct@dcs.ed.ac.uk)
Sun, 5 Apr 1998 19:47:18 +0100


Hi,

On 04 Apr 1998 14:51:13 -0500, ebiederm+eric@npwt.net (Eric
W. Biederman) said:

> in mm/vmscan.c kswapd()

> why do we call schedule() instead of interruptible_sleep_on(kswapd_wait) ?

The mechanism in vmscan.c ensures that kswapd never misses a "tick". By
setting the task's state to TASK_INTERRUPTIBLE after the schedule(), we
ensure that the schedule() puts us to sleep if and only if there has
been no swap_tick since the last schedule() call.

I'm not saying that this behaviour is correct, mind youL

> My problem that lead to probe into this is I have some filesystem that
> currently resides in swap. As I was stress testing I go to the point
> where my memory mostly filled up. About one page per free list, and
> the system slowed to a crawl. And it stayed in a crawl for a long
> time. This was realtively easy to trigger.

That's probably what you would expect to see if the kswapd scan was
taking more than one tick to complete, so it was never giving up the
CPU. Using interruptible_sleep_on() would ensure that it does sleep
every so often under those conditions.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu