Re: A possible winner in pre7-8

Rik van Riel
2000-05-10T18:11:03Z

On Wed, 10 May 2000, Linus Torvalds wrote:

> 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.

I'm sorry to dissapoint you, but I'm afraid this isn't
the bug. Please look at this code from vmscan.c...

int try_to_free_pages(unsigned int gfp_mask, zone_t *zone)
{
int retval = 1;

if (gfp_mask & __GFP_WAIT) {
current->flags |= PF_MEMALLOC;
retval = do_try_to_free_pages(gfp_mask, zone);
current->flags &= ~PF_MEMALLOC;
}
return retval;
}

As you see, we never call do_try_to_free_pages() if we don't
have __GFP_WAIT set. And GFP_ATOMIC doesn't include __GFP_WAIT.

regards,

Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.

Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies
http://www.conectiva.com/ http://www.surriel.com/