Re: [patch 6/6] jbd2: remove dependency on __GFP_NOFAIL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 22 Jul 2010, Ted Ts'o wrote:

> > I'll change this to
> > 
> > 	do {
> > 		new_transaction = kzalloc(sizeof(*new_transaction),
> > 							GFP_NOFS);
> > 	} while (!new_transaction);
> > 
> > in the next phase when I introduce __GFP_KILLABLE (that jbd and jbd2 can't 
> > use because they are GFP_NOFS).
> 
> OK, I can carry a patch which does this in the ext4 tree to push to
> linus when the merge window opens shortly, since the goal is you want
> to get rid of __GFP_NOFAIL altogether, right?
> 

Yup, I was trying to do the removal in two phases.

First, remove __GFP_NOFAIL from callers that don't seem to need it.  I 
found that they were actually needed in some cases such as jbd, jbd2, and 
sparc although the reason was specific to those subsystems at a higher 
level and their error handling was actually unused code since __GFP_NOFAIL 
cannot return NULL.

Second, replace __GFP_NOFAIL with __GFP_KILLABLE which converts existing 
users of __GFP_NOFAIL into the do-while loop above and adding 
__GFP_KILLABLE for allocations allowing __GFP_FS which does memory 
compaction for order > 0, direct reclaim, and the oom killer but does not 
retry the allocation.  That would be the responsibility of the caller.  
This ends up removing several branches from the page allocator.

I didn't think about converting the existing GFP_NOFS | __GFP_NOFAIL 
callers into the do-while loop above until you mentioned it, thanks.  I'll 
send patches to do that shortly.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]