fs,xfs: Use __GFP_MOVABLE for XFS buffers
Subsystems (2)
RFC PATCH 1/1 fs,xfs: Use __GFP_MOVABLE for XFS buffers
Fragmentation avoidance in the kernel depends on reclaimable and movable allocations being marked-up at page allocation time. Reclaimable allocations refer to slab caches such as inode caches which can be reclaimed although not necessarily in a targetted fashion. Movable pages are those pages that can be moved to backing storage (during page reclaim) or migrated.
When testing against XFS, it was noticed that large page allocation rates against XFS were far lower than expected in comparison to ext3. Investigation showed that buffer pages allocated by XFS are placed on the LRU but not marked __GFP_MOVABLE at allocation time.
This patch updates xb_to_gfp() to specify __GFP_MOVABLE and is correct iff all pages allocated from a mask derived from xb_to_gfp() are guaranteed to be movable be it via page reclaim or page migration. It needs an XFS expert to make that determination but when applied, huge page allocation success rates are similar to those seen on tests backed by ext3.
--- fs/xfs/linux-2.6/xfs_buf.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/xfs/linux-2.6/xfs_buf.c +1 -1
@@ -67,7 +67,7 @@ struct workqueue_struct *xfsconvertd_workqueue;#define xb_to_gfp (flags) \ ((((flags) & XBF_READ_AHEAD) ? __GFP_NORETRY : \ - ((flags) & XBF_DONT_BLOCK) ? GFP_NOFS : GFP_KERNEL) | __GFP_NOWARN) + ((flags) & XBF_DONT_BLOCK) ? GFP_NOFS : GFP_KERNEL) | __GFP_NOWARN | __GFP_MOVABLE)#define xb_to_km (flags) \ (((flags) & XBF_DONT_BLOCK) ? KM_NOFS : KM_SLEEP)
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 11 lines · Mel Gorman
Fragmentation avoidance in the kernel depends on reclaimable and movable allocations being marked-up at page allocation time. Reclaimable allocations refer to slab caches such as inode caches which can be reclaimed although not necessarily in a targetted fashion. Movable pages are those pages that can be moved to backing storage (during page reclaim) or migrated.
When testing against XFS, it was noticed that large page allocation rates against XFS were far lower than expected in comparison to ext3. Investigation showed that buffer pages allocated by XFS are placed on the LRU but not marked
__GFP_MOVABLEat allocation time.
Quoted 7 lines
This patch updates
xb_to_gfp()to specify__GFP_MOVABLEand is correct iff all pages allocated from a mask derived fromxb_to_gfp()are guaranteed to be movable be it via page reclaim or page migration. It needs an XFS expert to make that determination but when applied, huge page allocation success rates are similar to those seen on tests backed by ext3.Signed-off-by Mel Gorman <[email protected]>
I don't see any problems with this, but I don't think it's going to be useful for very long given the work I'm doing on the XFS buffer cache right now - converting it to caching buffers with a shrinker traversed LRU for reclaim instead of using the page cache and hoping reclaim doesn't trash the working set.
I'm hoping to have it done in time for the .37 merge window, so adding __GFP_MOVEABLE now might not to even see a release....
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 18 lines · Dave Chinner
Quoted 17 lines · Mel Gorman
Fragmentation avoidance in the kernel depends on reclaimable and movable allocations being marked-up at page allocation time. Reclaimable allocations refer to slab caches such as inode caches which can be reclaimed although not necessarily in a targetted fashion. Movable pages are those pages that can be moved to backing storage (during page reclaim) or migrated.
When testing against XFS, it was noticed that large page allocation rates against XFS were far lower than expected in comparison to ext3. Investigation showed that buffer pages allocated by XFS are placed on the LRU but not marked
__GFP_MOVABLEat allocation time.This patch updates
xb_to_gfp()to specify__GFP_MOVABLEand is correct iff all pages allocated from a mask derived fromxb_to_gfp()are guaranteed to be movable be it via page reclaim or page migration. It needs an XFS expert to make that determination but when applied, huge page allocation success rates are similar to those seen on tests backed by ext3.
Quoted 8 lines
Quoted 1 line
Signed-off-by Mel Gorman <[email protected]>I don't see any problems with this, but I don't think it's going to be useful for very long given the work I'm doing on the XFS buffer cache right now - converting it to caching buffers with a shrinker traversed LRU for reclaim instead of using the page cache and hoping reclaim doesn't trash the working set.
THat's ok. After I sent the patch, I ran another test with just this patch applied and the success rates are still much lower than ext3. My initial results had other patches in the mix confusing the results. There also appears to be allocations that should have got __GFP_RECLAIMABLE.
Quoted 3 lines
I'm hoping to have it done in time for the .37 merge window, so adding
__GFP_MOVEABLEnow might not to even see a release....
I'll revisit it later so and see can I spot what allocations need to be marked up to play nicely with fragmentation avoidance. Thanks
Signature · 8 lines
Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs