fs/f2fs: replace open coded nofail allocation in __add_ino_entry
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 fs/f2fs: replace open coded nofail allocation in __add_ino_entry
__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.
--- fs/f2fs/checkpoint.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
fs/f2fs/checkpoint.c +1 -6
@@ -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);
Signature · 10 lines
1.9.1 . ------------------------------------------------------------------------------
Jaegeuk Kim
maintainerHi Zhang,
Quoted 14 lines · Zhang Zhen
__add_ino_entryis looping around the allocation request and minics__GFP_NOFAILbehavior without any allocation fallback strategy. Here remove the open coded loop and replace it with__GFP_NOFAIL.Signed-off-by Zhang Zhen <[email protected]>--- fs/f2fs/checkpoint.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)fs/f2fs/checkpoint.c +0
-0
fs/f2fs/checkpoint.c retry: · line 340
Quoted 10 lines
fs/f2fs/checkpoint.c +1
-6@@ -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,
Quoted 18 lines
fs/f2fs/checkpoint.c +0
-0if (radix_tree_insert (&im->ino_root, ino, e)) {spin_unlock (&im->ino_lock);kmem_cache_free (ino_entry_slab, e);Signature · 14 lines
1.9.1 . ------------------------------------------------------------------------------ _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
------------------------------------------------------------------------------
Quoted 18 lines · Jaegeuk Kim
Hi Zhang,
Quoted 15 lines · Zhang Zhen
__add_ino_entryis looping around the allocation request and minics__GFP_NOFAILbehavior without any allocation fallback strategy. Here remove the open coded loop and replace it with__GFP_NOFAIL.Signed-off-by Zhang Zhen <[email protected]>--- fs/f2fs/checkpoint.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)fs/f2fs/checkpoint.c +0
-0@@ -337,12 +337,7 @@ retry:
Quoted 13 lines
fs/f2fs/checkpoint.c retry: · line 340
Quoted 9 lines
fs/f2fs/checkpoint.c +1
-6e =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_ATOMICwithGFP_NOFS. We can avoid to useGFP_ATOMIChere, right?
Yes, i think so.
Quoted 22 lines
Thanks,
Quoted 18 lines
fs/f2fs/checkpoint.c +0
-0if (radix_tree_insert (&im->ino_root, ino, e)) {spin_unlock (&im->ino_lock);kmem_cache_free (ino_entry_slab, e);Signature · 14 lines
1.9.1 . ------------------------------------------------------------------------------ _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
------------------------------------------------------------------------------