All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
@ 2010-09-09 11:11 ` Mel Gorman
  0 siblings, 0 replies; 9+ messages in thread
From: Mel Gorman @ 2010-09-09 11:11 UTC (permalink / raw)
  To: xfs; +Cc: Alex Elder, Dave Chinner, linux-kernel, linux-mm

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.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 fs/xfs/linux-2.6/xfs_buf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index ea79072..93f3fb0 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -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)

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

* [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
@ 2010-09-09 11:11 ` Mel Gorman
  0 siblings, 0 replies; 9+ messages in thread
From: Mel Gorman @ 2010-09-09 11:11 UTC (permalink / raw)
  To: xfs; +Cc: linux-mm, linux-kernel, Alex Elder

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.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 fs/xfs/linux-2.6/xfs_buf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index ea79072..93f3fb0 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
@ 2010-09-09 11:11 ` Mel Gorman
  0 siblings, 0 replies; 9+ messages in thread
From: Mel Gorman @ 2010-09-09 11:11 UTC (permalink / raw)
  To: xfs; +Cc: Alex Elder, Dave Chinner, linux-kernel, linux-mm

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.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 fs/xfs/linux-2.6/xfs_buf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index ea79072..93f3fb0 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -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)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
  2010-09-09 11:11 ` Mel Gorman
  (?)
@ 2010-09-10  0:37   ` Dave Chinner
  -1 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2010-09-10  0:37 UTC (permalink / raw)
  To: Mel Gorman; +Cc: xfs, Alex Elder, linux-kernel, linux-mm

On Thu, Sep 09, 2010 at 12:11:32PM +0100, Mel Gorman wrote:
> 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.
> 
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>

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.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
@ 2010-09-10  0:37   ` Dave Chinner
  0 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2010-09-10  0:37 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-mm, Alex Elder, linux-kernel, xfs

On Thu, Sep 09, 2010 at 12:11:32PM +0100, Mel Gorman wrote:
> 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.
> 
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>

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.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
@ 2010-09-10  0:37   ` Dave Chinner
  0 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2010-09-10  0:37 UTC (permalink / raw)
  To: Mel Gorman; +Cc: xfs, Alex Elder, linux-kernel, linux-mm

On Thu, Sep 09, 2010 at 12:11:32PM +0100, Mel Gorman wrote:
> 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.
> 
> Signed-off-by: Mel Gorman <mel@csn.ul.ie>

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.
-- 
Dave Chinner
david@fromorbit.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
  2010-09-10  0:37   ` Dave Chinner
  (?)
@ 2010-09-10  8:33     ` Mel Gorman
  -1 siblings, 0 replies; 9+ messages in thread
From: Mel Gorman @ 2010-09-10  8:33 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs, Alex Elder, linux-kernel, linux-mm

On Fri, Sep 10, 2010 at 10:37:06AM +1000, Dave Chinner wrote:
> On Thu, Sep 09, 2010 at 12:11:32PM +0100, Mel Gorman wrote:
> > 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.
> > 
> > Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> 
> 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.

> 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....
> 

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

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

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

* Re: [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
@ 2010-09-10  8:33     ` Mel Gorman
  0 siblings, 0 replies; 9+ messages in thread
From: Mel Gorman @ 2010-09-10  8:33 UTC (permalink / raw)
  To: Dave Chinner; +Cc: linux-mm, Alex Elder, linux-kernel, xfs

On Fri, Sep 10, 2010 at 10:37:06AM +1000, Dave Chinner wrote:
> On Thu, Sep 09, 2010 at 12:11:32PM +0100, Mel Gorman wrote:
> > 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.
> > 
> > Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> 
> 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.

> 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....
> 

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

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers
@ 2010-09-10  8:33     ` Mel Gorman
  0 siblings, 0 replies; 9+ messages in thread
From: Mel Gorman @ 2010-09-10  8:33 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs, Alex Elder, linux-kernel, linux-mm

On Fri, Sep 10, 2010 at 10:37:06AM +1000, Dave Chinner wrote:
> On Thu, Sep 09, 2010 at 12:11:32PM +0100, Mel Gorman wrote:
> > 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.
> > 
> > Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> 
> 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.

> 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....
> 

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

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2010-09-10  8:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-09 11:11 [RFC PATCH] fs,xfs: Use __GFP_MOVABLE for XFS buffers Mel Gorman
2010-09-09 11:11 ` Mel Gorman
2010-09-09 11:11 ` Mel Gorman
2010-09-10  0:37 ` Dave Chinner
2010-09-10  0:37   ` Dave Chinner
2010-09-10  0:37   ` Dave Chinner
2010-09-10  8:33   ` Mel Gorman
2010-09-10  8:33     ` Mel Gorman
2010-09-10  8:33     ` Mel Gorman

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.