lkml.org 
[lkml]   [2004]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.6.5-aa1 arch updates
Andrew Morton <akpm@osdl.org> wrote:
>
> Hugh Dickins <hugh@veritas.com> wrote:
> >
> > I notice that's a __GFP_REPEAT allocation, but even those fail when
> > OOM-killed - I find its alias __GFP_NOFAIL very misleading.
>
> #define __GFP_REPEAT 0x400 /* Retry the allocation. Might fail */
> #define __GFP_NOFAIL 0x800 /* Retry for ever. Cannot fail */
>
> __GFP_REPEAT is mainly for higher-order allocations which would otherwise
> have given up too early.

It all comes back to me now. The reason there is a __GFP_REPEAT in the
pte_alloc_one() implementations is that lots of architectures used to do
stuff like this:

static inline pte_t *
pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
{
int count = 0;
pte_t *pte;
do {
pte = (pte_t *)__get_free_page(GFP_KERNEL);
if (pte)
clear_page(pte);
else {
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ);
}
} while (!pte && (count++ < 10));
return pte;
}
That was all removed and the __GFP_REPEAT flag was added instead, as a "try
really hard" hint to the page allocator.

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

\
 
 \ /
  Last update: 2005-03-22 14:02    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site