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

Randy Dunlap
2009-05-26T01:03:19Z

KOSAKI Motohiro wrote:
>>>> @@ -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?

Do you mean put that info in the patch description?
That would be OK.

>>> 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};

--
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon