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

Christoph Lameter
2009-05-26T21:05:51Z

On Tue, 26 May 2009, Andrew Morton wrote:

> On Tue, 26 May 2009 16:54:58 -0400 (EDT)
> Christoph Lameter <cl@linux.com> wrote:
>
> > On Tue, 26 May 2009, Andrew Morton wrote:
> >
> > > I still worry that there may be usage patterns which will result in
> > > this message coming out many times.
> >
> > Note that vm_swa_full is defined the following way
> >
> > #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
> >
> > This means that vm_swap_full is true when more than 50% of swap are in
> > use. The printed flag will therefore only be cleared if swap use falls to
> > less than half.
>
> (which was highly relevant changelog material)

I thought everyone knew since they were pointing to it. There is a comment
where vm_swap_full() is defined.

> OK. But it that optimal?

Not sure but it certainly makes the messages rather infrequent. I would
personally be satisifed with a single message if it occurs for the first
time. Someone tinkering around with swap space is rare at least on
machines that are supposed to do real work and I really do not want
printk storms during development.