Re: Time for a pre-patch-2.0.31-3?

Benjamin C R LaHaise (blah@dot.superaje.com)
Thu, 3 Jul 1997 15:10:49 +0000 ( )


Hello!

Sorry, I mangled this a bit (I've finally found a reason for multiple
undo ;), but what follows is the important part...

Changes to kswapd()
> + try_to_free_page(GFP_KERNEL, 0, (nr_free_pages < min_free_pages));
> }
>
> this should not be a problem, shouldn't it?

Nope, and its probably a good thing, unless... We now have a situation
where kswapd itself will go to sleep waiting on disk io, but it may
have been possible to free up pages otherwise. Hrmm maybe it should
be syncronous if nr_free_pages < min_free_pages && nr_async_pages > X?
I'll play around with my 386 klunker tonight.

> Only the change in swap_tick()
>
> - next_swap_jiffies = jiffies + swapout_interval;
> + /* low on memory, we need to start swapping soon */
> + if(last_wakeup_low)
> + next_swap_jiffies = jiffies;
> + else
> + next_swap_jiffies = jiffies + swapout_interval;
>
> may cause a problem. If I understand your hint correct, kswapd will be waked
> up in a loop without running any other process if the last call can not free a
> physical page due to a low swap space.

That's exactly it - otherwise there is no reason for the silliness with
last_wakeup_low. The setting of next_swap_jiffies should really be in
kswapd after it has finished making its passes as I did in my patch.

> One question more: Does my version of try_to_free_page() run cause
> any trouble with the version of your kswapd/swap_tick solution
> given in ftp://dot.superaje.com/pub/linux/blah-mm-2.1.42-2.diff?

Just yank the if refering to age_interval. Don't forget to add the
setting of next_swap_jiffies to kswapd().

-ben