[Ocfs2-devel] [PATCH 2/3] Ocfs2: Add a new code 'OCFS2_INFO_FREEINODE' for o2info ioctl.
    Tristan Ye 
    tristan.ye at oracle.com
       
    Tue Feb 22 00:02:15 PST 2011
    
    
  
Joel Becker wrote:
> On Tue, Feb 22, 2011 at 12:59:51PM +0800, Tristan Ye wrote:
>> +	oifi = kzalloc(sizeof(struct ocfs2_info_freeinode), GFP_NOFS);
>
> 	Why NOFS?  Are we under any filesystem locks?  I'm pretty sure
> this is the first thing you do for this operation, so why wouldn't
> GFP_KERNEL work?
Joel,
    Thanks for putting forward the point. I'm afraid that I'm not an 
enough experienced
user to talk issues on 'GFP_NOFS VS GFP_KERNEL' too much;-)
   
    Per my understanding, can the GFP_NOFS become a real overkill when 
claiming around 2k memory?
Having known that GFP_NOFS is more restrictive and more secure to 
filesystem code for avoiding potential
deadlock, do we really need to use GFP_KERNEL instead of GFP_NOFS there?
    Btw, is there a explicit rule/convention on when to use GFP_NOFS or 
GFP_KERNEL? e.g:
*) Use GFP_NOFS after some locks being held.
*) Use GFP_NOFS in functions which are called by filesystems?
Regards,
Tristan
>
> Joel
>
    
    
More information about the Ocfs2-devel
mailing list