Re: [patch 1/6] md: remove dependency on __GFP_NOFAIL

From: David Rientjes
Date: Mon Aug 23 2010 - 16:38:05 EST


On Mon, 23 Aug 2010, Andrew Morton wrote:

> > > Hows about you add a helper function
> > >
> > > void *[kmalloc|alloc_page]_retrying_forever_because_i_suck(lots of args)
> > >
> > > then convert the callsites to use that, then nuke __GFP_NOFAIL?
> > >
> >
> > That would only serve as documentation
>
> Is that bad?
>

It implies that these calls are special in some way, basically to mean
we have no sane error handling for failures, when in reality this is only
a function of the allocation order when the context does not have
__GFP_FS. You may as well just add BUG_ON(!nreg) here instead.

I thought my "/* FIXME: this may potentially loop forever */" was
sufficient to mean that the allocation must succeed independent of the
page allocator's implementation, but perhaps you find greping for
[kmalloc|alloc_page.*]_nofail easier?

I'm not sure what flags such a function would be checking for since the
page allocator determines whether the oom killer is called or not. If
current is killed, an order-0 allocation will succeed because of
TIF_MEMDIE, and if another task is killed, we must still loop waiting for
the free memory even with __GFP_FS.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/