Re: [PATCH] reiserfs: use __GFP_NOFAIL instead of yield and retryloop for allocation

From: Andrew Morton
Date: Fri Jan 13 2006 - 02:54:42 EST


Pekka J Enberg <penberg@xxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> Pekka J Enberg <penberg@xxxxxxxxxxxxxx> wrote:
> > >
> > > - retry:
> > > - jl = kzalloc(sizeof(struct reiserfs_journal_list), GFP_NOFS);
> > > - if (!jl) {
> > > - yield();
> > > - goto retry;
> > > - }
> > > + jl = kzalloc(sizeof(struct reiserfs_journal_list),
> > > + GFP_NOFS | __GFP_NOFAIL);
>
> On Thu, 12 Jan 2006, Andrew Morton wrote:
> > yup, that's what __GFP_NOFAIL is for: to consolidate and identify all those
> > places which want to lock up when we're short of memory... They all need
> > fixing, really.
>
> Out of curiosity, are there any potential problems with combining GFP_NOFS
> and __GFP_NOFAIL? Can we really guarantee to give out memory if we're not
> allowed to page out?
>

GFP_NOFS increases the risk (relative to GFP_KERNEL) because page reclaim
can do less things than GFP_KERNEL to free memory.

GFP_NOFS allocations can still perform swapspace writes, however. GFP_NOIO
cannot even do that.
-
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/