Re: [PATCH] Warn if we run out of swap space

KOSAKI Motohiro
2009-05-26T00:40:18Z

> >> @@ -410,6 +411,10 @@ swp_entry_t get_swap_page(void)
> >> }
> >>
> >> nr_swap_pages++;
> >> + if (!printed) {
> >> + printed = 1;
> >> + printk(KERN_WARNING "All of swap is in use. Some pages cannot be swapped out.");
> >> + }
> >
> > Why don't you use WARN_ONCE()?
>
> Someone earlier in this patch thread (maybe Pavel?) commented that
> WARN_ONCE() would cause a stack dump and that would be too harsh,
> especially for users. I.e., just the message is needed here, not a
> stack dump.

Ah, makes sense.
I agree with you.

So, adding patch description is better?

>
> > lumpy reclaim on no swap system makes this warnings, right?
> > if so, I think it's a bit annoy.
> >
> >> noswap:
> >> spin_unlock(&swap_lock);
> >> return (swp_entry_t) {0};