Re: A possible winner in pre7-8

Linus Torvalds
2000-05-10T15:31:03Z

On 10 May 2000, Juan J. Quintela wrote:
>
> It begin to kill processes after the 10th iteration. After that, the
> machine freezes.

Do you have a SMP machine? If so, I think I found this one.

And it's been there for ages.

The bug is that GFP_ATOMIC _really_ must not try to page stuff out,
eventhe stuff that doesn't need IO to be dropped.

Why? Because GFP_ATOMIC can be (and mostly is) called from interrupts, and
even when we don't do IO we _do_ access a number of spinlocks in order to
see whether we can even just drop it.

For example, in order to scan the page tables we take the page_table_lock
("vmlist_access_lock") which is not irq-safe.

So the lockup will occur if you take an interrupt that does an allocation
(usually networking-related) while you hold the page_table_lock (which can
be due to a swapout, for example).

The reason it has been there for long is that usually SMP machines have
enough memory that this condition is really hard to trigger in normal use.
And on UP machines you'd never see the problem (except, possibly, as page
table double-freeing, but the window for that looks extremely small
indeed, much smaller than the double-spinlock window).

Linus