Btrfs: use arg gfp_mask to decide how to allocate tree mod
A message that is not in the archive (sent off-list or not yet received): [email protected]
It seems the original code doesn't pass the right arg gfp_t to decide how to allocate. Just applying this patch, fsstress will fail. So please ignore this patch, will resend later..
Thanks,
Wang
Quoted 26 lines
From: Wang Shilong <[email protected]>
We have passed arg
gfp_masktotree_mod_alloc(), so just use it rather than always useGFP_ATOMIC.Signed-off-by Wang Shilong <[email protected]>---
fs/btrfs/ctree.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/btrfs/ctree.c +1
-1@@ -553,7 +553,7 @@ static inline int tree_mod_alloc(struct btrfs_fs_info *fs_info, gfp_t flags,* once we switch from spin locks to something different, we should * honor the flags parameter here. */ - tm = *tm_ret =kzalloc (sizeof (*tm),GFP_ATOMIC ); + tm = *tm_ret =kzalloc (sizeof (*tm), flags);if (!tm)return -ENOMEM ;Signature · 1 line
1.7.11.7
Quoted 2 lines · Wang Shilong
It seems the original code doesn't pass the right arg
gfp_tto decide how to allocate. Just applying this patch, fsstress will fail. So please ignore this patch, will resend later..
That's in fact what the comment above the line you changed implies :-)
-Jan
Quoted 35 lines
Thanks,
WangQuoted 26 lines
From: Wang Shilong <[email protected]>
We have passed arg
gfp_masktotree_mod_alloc(), so just use it rather than always useGFP_ATOMIC.Signed-off-by Wang Shilong <[email protected]>---
fs/btrfs/ctree.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/btrfs/ctree.c +1
-1@@ -553,7 +553,7 @@ static inline int tree_mod_alloc(struct btrfs_fs_info *fs_info, gfp_t flags,* once we switch from spin locks to something different, we should * honor the flags parameter here. */ - tm = *tm_ret =kzalloc (sizeof (*tm),GFP_ATOMIC ); + tm = *tm_ret =kzalloc (sizeof (*tm), flags);if (!tm)return -ENOMEM ;Signature · 1 line
1.7.11.7--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello Jan,
Quoted 5 lines · Wang Shilong
Quoted 2 lines
It seems the original code doesn't pass the right arg
gfp_tto decide how to allocate. Just applying this patch, fsstress will fail. So please ignore this patch, will resend later..That's in fact what the comment above the line you changed implies :-)
e.. It seems tree_mod_alloc() will always allocate with GFP_ATOMIC in your code. However, i think we should try best not to allocate with GTP_ATOMIC.. otherwise, at least.. the arg gfp_t you try to pass is useless and should be removed ^_^
Thanks,
Wang
Quoted 43 lines
-Jan
Quoted 26 lines
Thanks,
WangQuoted 23 lines
From: Wang Shilong <[email protected]>
We have passed arg
gfp_masktotree_mod_alloc(), so just use it rather than always useGFP_ATOMIC.Signed-off-by Wang Shilong <[email protected]>---
fs/btrfs/ctree.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/btrfs/ctree.c +1
-1@@ -553,7 +553,7 @@ static inline int tree_mod_alloc(struct btrfs_fs_info *fs_info, gfp_t flags,* once we switch from spin locks to something different, we should * honor the flags parameter here. */ - tm = *tm_ret =kzalloc (sizeof (*tm),GFP_ATOMIC ); + tm = *tm_ret =kzalloc (sizeof (*tm), flags);if (!tm)return -ENOMEM ;Quoted 8 lines
Quoted 3 lines
Signature · 1 line
1.7.11.7--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
oops, i just miswrite my working email "[email protected]" to "[email protected]" So please do not cc at that email address. sorry, my bad.
Thanks,
Wang
Quoted 67 lines
Hello Jan,
Quoted 4 lines · Wang Shilong
Quoted 2 lines
It seems the original code doesn't pass the right arg
gfp_tto decide how to allocate. Just applying this patch, fsstress will fail. So please ignore this patch, will resend later..That's in fact what the comment above the line you changed implies :-)
e.. It seems
tree_mod_alloc()will always allocate withGFP_ATOMICin your code. However, i think we should try best not to allocate withGTP_ATOMIC.. otherwise, at least.. the arggfp_tyou try to pass is useless and should be removed ^_^Thanks,
WangQuoted 36 lines
-Jan
Quoted 26 lines
Thanks,
WangQuoted 23 lines
From: Wang Shilong <[email protected]>
We have passed arg
gfp_masktotree_mod_alloc(), so just use it rather than always useGFP_ATOMIC.Signed-off-by Wang Shilong <[email protected]>---
fs/btrfs/ctree.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/btrfs/ctree.c +1
-1@@ -553,7 +553,7 @@ static inline int tree_mod_alloc(struct btrfs_fs_info *fs_info, gfp_t flags,* once we switch from spin locks to something different, we should * honor the flags parameter here. */ - tm = *tm_ret =kzalloc (sizeof (*tm),GFP_ATOMIC ); + tm = *tm_ret =kzalloc (sizeof (*tm), flags);if (!tm)return -ENOMEM ;Quoted 8 lines
Quoted 3 lines
Signature · 1 line
1.7.11.7--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlQuoted 6 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html