Re: [PATCH] add PF_MEMALLOC to __alloc_pages()

Zlatko Calusic (zlatko@iskon.hr)
04 Jan 2001 00:03:13 +0100


Rik van Riel <riel@conectiva.com.br> writes:

> Hi Linus, Alan, Mike,
>
> the following patch sets PF_MEMALLOC for the current task
> in __alloc_pages() to avoid infinite recursion when we try
> to free memory from __alloc_pages().
>
> Please apply the patch below, which fixes this (embarrasing)
> bug...
>
[snip]
> * free ourselves...
> */
> } else if (gfp_mask & __GFP_WAIT) {
> + current->flags |= PF_MEMALLOC;
> try_to_free_pages(gfp_mask);
> + current->flags &= ~PF_MEMALLOC;
> memory_pressure++;
> if (!order)
> goto try_again;
>

Hm, try_to_free_pages already sets the PF_MEMALLOC flag!

-- 
Zlatko
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/