xfs: Drop setting redundant PF_KSWAPD in kswapd context
Subsystems (2)
PATCH 1/1 xfs: Drop setting redundant PF_KSWAPD in kswapd context
xfs_btree_split() calls xfs_btree_split_worker() with args.kswapd set if current->flags alrady has PF_KSWAPD. Hence we should not again add PF_KSWAPD into the current flags inside kswapd context. So drop this redundant flag addition.
--- fs/xfs/libxfs/xfs_btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_btree.c +1 -1
@@ -2895,7 +2895,7 @@ struct xfs_btree_split_args {* in any way. */ if (args->kswapd) - new_pflags |=PF_MEMALLOC |PF_SWAPWRITE |PF_KSWAPD ; + new_pflags |=PF_MEMALLOC |PF_SWAPWRITE ;current_set_flags_nested (&pflags, new_pflags);
Signature · 1 line
1.8.5.2
Quoted 4 lines · Anshuman Khandual
xfs_btree_split()callsxfs_btree_split_worker()with args.kswapd set ifcurrent->flagsalrady hasPF_KSWAPD. Hence we should not again addPF_KSWAPDinto the current flags inside kswapd context. So drop this redundant flag addition.
I am not familiar with the code but your change seems incorect. The whole point of args->kswapd is to convey the kswapd context to the worker which is obviously running in a different context. So this patch loses the kswapd context.
Quoted 20 lines
Signed-off-by Anshuman Khandual <[email protected]>--- fs/xfs/libxfs/xfs_btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/libxfs/xfs_btree.c +1
-1@@ -2895,7 +2895,7 @@ struct xfs_btree_split_args {* in any way. */ if (args->kswapd) - new_pflags |=PF_MEMALLOC |PF_SWAPWRITE |PF_KSWAPD ; + new_pflags |=PF_MEMALLOC |PF_SWAPWRITE ;current_set_flags_nested (&pflags, new_pflags);Signature · 1 line
1.8.5.2
Signature · 2 lines
Michal Hocko SUSE Labs
Quoted 10 lines · Michal Hocko
Quoted 4 lines · Anshuman Khandual
xfs_btree_split()callsxfs_btree_split_worker()with args.kswapd set ifcurrent->flagsalrady hasPF_KSWAPD. Hence we should not again addPF_KSWAPDinto the current flags inside kswapd context. So drop this redundant flag addition.I am not familiar with the code but your change seems incorect. The whole point of
args->kswapdis to convey the kswapd context to the worker which is obviously running in a different context. So this patch loses the kswapd context.
Yup. That's what the code does, and removing the PF_KSWAPD from it will break it.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 7 lines · Dave Chinner
Quoted 6 lines · Michal Hocko
Quoted 4 lines · Anshuman Khandual
xfs_btree_split()callsxfs_btree_split_worker()with args.kswapd set ifcurrent->flagsalrady hasPF_KSWAPD. Hence we should not again addPF_KSWAPDinto the current flags inside kswapd context. So drop this redundant flag addition.
Quoted 7 lines
Quoted 4 lines
I am not familiar with the code but your change seems incorect. The whole point of
args->kswapdis to convey the kswapd context to the worker which is obviously running in a different context. So this patch loses the kswapd context.Yup. That's what the code does, and removing the
PF_KSWAPDfrom it will break it.
The worker thread need to inherit these flags. Thanks for pointing out.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>