All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry
       [not found] <1440386638-40325-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2015-08-24  3:39 ` Zhang Zhen
  2015-08-24  4:56   ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang Zhen @ 2015-08-24  3:39 UTC (permalink / raw)
  To: jaegeuk, cm224.lee; +Cc: linux-f2fs-devel

__add_ino_entry is looping around the allocation request and minics
__GFP_NOFAIL behavior without any allocation fallback strategy.
Here remove the open coded loop and replace it with __GFP_NOFAIL.

Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
---
 fs/f2fs/checkpoint.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index b70bbe1..d62363b 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -337,12 +337,7 @@ retry:

 	e = radix_tree_lookup(&im->ino_root, ino);
 	if (!e) {
-		e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC);
-		if (!e) {
-			spin_unlock(&im->ino_lock);
-			radix_tree_preload_end();
-			goto retry;
-		}
+		e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC|__GFP_NOFAIL);
 		if (radix_tree_insert(&im->ino_root, ino, e)) {
 			spin_unlock(&im->ino_lock);
 			kmem_cache_free(ino_entry_slab, e);
-- 
1.9.1


.





------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry
  2015-08-24  3:39 ` [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry Zhang Zhen
@ 2015-08-24  4:56   ` Jaegeuk Kim
  2015-08-24  6:10     ` Zhang Zhen
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2015-08-24  4:56 UTC (permalink / raw)
  To: Zhang Zhen; +Cc: linux-f2fs-devel

Hi Zhang,

On Mon, Aug 24, 2015 at 11:39:55AM +0800, Zhang Zhen wrote:
> __add_ino_entry is looping around the allocation request and minics
> __GFP_NOFAIL behavior without any allocation fallback strategy.
> Here remove the open coded loop and replace it with __GFP_NOFAIL.
> 
> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
> ---
>  fs/f2fs/checkpoint.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index b70bbe1..d62363b 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -337,12 +337,7 @@ retry:
> 
>  	e = radix_tree_lookup(&im->ino_root, ino);
>  	if (!e) {
> -		e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC);
> -		if (!e) {
> -			spin_unlock(&im->ino_lock);
> -			radix_tree_preload_end();
> -			goto retry;
> -		}
> +		e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC|__GFP_NOFAIL);

I submitted a patch to replace GFP_ATOMIC with GFP_NOFS.
We can avoid to use GFP_ATOMIC here, right?

Thanks,

>  		if (radix_tree_insert(&im->ino_root, ino, e)) {
>  			spin_unlock(&im->ino_lock);
>  			kmem_cache_free(ino_entry_slab, e);
> -- 
> 1.9.1
> 
> 
> .
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry
  2015-08-24  4:56   ` Jaegeuk Kim
@ 2015-08-24  6:10     ` Zhang Zhen
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang Zhen @ 2015-08-24  6:10 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel

On 2015/8/24 12:56, Jaegeuk Kim wrote:
> Hi Zhang,
> 
> On Mon, Aug 24, 2015 at 11:39:55AM +0800, Zhang Zhen wrote:
>> __add_ino_entry is looping around the allocation request and minics
>> __GFP_NOFAIL behavior without any allocation fallback strategy.
>> Here remove the open coded loop and replace it with __GFP_NOFAIL.
>>
>> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
>> ---
>>  fs/f2fs/checkpoint.c | 7 +------
>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>> index b70bbe1..d62363b 100644
>> --- a/fs/f2fs/checkpoint.c
>> +++ b/fs/f2fs/checkpoint.c
>> @@ -337,12 +337,7 @@ retry:
>>
>>  	e = radix_tree_lookup(&im->ino_root, ino);
>>  	if (!e) {
>> -		e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC);
>> -		if (!e) {
>> -			spin_unlock(&im->ino_lock);
>> -			radix_tree_preload_end();
>> -			goto retry;
>> -		}
>> +		e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC|__GFP_NOFAIL);
> 
> I submitted a patch to replace GFP_ATOMIC with GFP_NOFS.
> We can avoid to use GFP_ATOMIC here, right?
> 
Yes, i think so.
> Thanks,
> 
>>  		if (radix_tree_insert(&im->ino_root, ino, e)) {
>>  			spin_unlock(&im->ino_lock);
>>  			kmem_cache_free(ino_entry_slab, e);
>> -- 
>> 1.9.1
>>
>>
>> .
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> 
> 



------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-24  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1440386638-40325-1-git-send-email-zhenzhang.zhang@huawei.com>
2015-08-24  3:39 ` [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry Zhang Zhen
2015-08-24  4:56   ` Jaegeuk Kim
2015-08-24  6:10     ` Zhang Zhen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.