All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 2/2] mm/vmscan: not check compaction_ready on promoted zones
@ 2014-02-14  6:42 ` Weijie Yang
  0 siblings, 0 replies; 4+ messages in thread
From: Weijie Yang @ 2014-02-14  6:42 UTC (permalink / raw)
  To: 'Mel Gorman'
  Cc: 'Andrew Morton', riel, 'Minchan Kim',
	weijie.yang.kh, 'Linux-MM', 'linux-kernel'

We abort direct reclaim if find the zone is ready for compaction.
Sometimes the zone is just a promoted highmem zone to force scan
pinning highmem, which is not the intended zone the caller want to
alloc page from. In this situation, setting aborted_reclaim to
indicate the caller turn back to retry allocation is waste of time
and could cause a loop in __alloc_pages_slowpath().

This patch do not check compaction_ready() on promoted zones to avoid
the above situation, only set aborted_reclaim if the caller intended
zone is ready to compaction.

Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
---
 mm/vmscan.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index da0a87c..9ec6519 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2299,6 +2299,7 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
 	unsigned long nr_soft_scanned;
 	bool aborted_reclaim = false;
 	gfp_t orig_mask = sc->gfp_mask;
+	enum zone_type requested_highidx = gfp_zone(sc->gfp_mask);
 
 	/*
 	 * If the number of buffer_heads in the machine exceeds the maximum
@@ -2332,7 +2333,8 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
 				 * noticeable problem, like transparent huge
 				 * page allocations.
 				 */
-				if (compaction_ready(zone, sc)) {
+				if ((zonelist_zone_idx(z) <= requested_highidx)
+				    && compaction_ready(zone, sc)) {
 					aborted_reclaim = true;
 					continue;
 				}
-- 
1.7.10.4



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

* [PATCH V2 2/2] mm/vmscan: not check compaction_ready on promoted zones
@ 2014-02-14  6:42 ` Weijie Yang
  0 siblings, 0 replies; 4+ messages in thread
From: Weijie Yang @ 2014-02-14  6:42 UTC (permalink / raw)
  To: 'Mel Gorman'
  Cc: 'Andrew Morton', riel, 'Minchan Kim',
	weijie.yang.kh, 'Linux-MM', 'linux-kernel'

We abort direct reclaim if find the zone is ready for compaction.
Sometimes the zone is just a promoted highmem zone to force scan
pinning highmem, which is not the intended zone the caller want to
alloc page from. In this situation, setting aborted_reclaim to
indicate the caller turn back to retry allocation is waste of time
and could cause a loop in __alloc_pages_slowpath().

This patch do not check compaction_ready() on promoted zones to avoid
the above situation, only set aborted_reclaim if the caller intended
zone is ready to compaction.

Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
---
 mm/vmscan.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index da0a87c..9ec6519 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2299,6 +2299,7 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
 	unsigned long nr_soft_scanned;
 	bool aborted_reclaim = false;
 	gfp_t orig_mask = sc->gfp_mask;
+	enum zone_type requested_highidx = gfp_zone(sc->gfp_mask);
 
 	/*
 	 * If the number of buffer_heads in the machine exceeds the maximum
@@ -2332,7 +2333,8 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
 				 * noticeable problem, like transparent huge
 				 * page allocations.
 				 */
-				if (compaction_ready(zone, sc)) {
+				if ((zonelist_zone_idx(z) <= requested_highidx)
+				    && compaction_ready(zone, sc)) {
 					aborted_reclaim = true;
 					continue;
 				}
-- 
1.7.10.4


--
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] 4+ messages in thread

* Re: [PATCH V2 2/2] mm/vmscan: not check compaction_ready on promoted zones
  2014-02-14  6:42 ` Weijie Yang
@ 2014-02-14 11:04   ` Mel Gorman
  -1 siblings, 0 replies; 4+ messages in thread
From: Mel Gorman @ 2014-02-14 11:04 UTC (permalink / raw)
  To: Weijie Yang
  Cc: 'Andrew Morton', riel, 'Minchan Kim',
	weijie.yang.kh, 'Linux-MM', 'linux-kernel'

On Fri, Feb 14, 2014 at 02:42:34PM +0800, Weijie Yang wrote:
> We abort direct reclaim if find the zone is ready for compaction.
> Sometimes the zone is just a promoted highmem zone to force scan
> pinning highmem, which is not the intended zone the caller want to
> alloc page from. In this situation, setting aborted_reclaim to
> indicate the caller turn back to retry allocation is waste of time
> and could cause a loop in __alloc_pages_slowpath().
> 
> This patch do not check compaction_ready() on promoted zones to avoid
> the above situation, only set aborted_reclaim if the caller intended
> zone is ready to compaction.
> 
> Acked-by: Rik van Riel <riel@redhat.com>
> Signed-off-by: Weijie Yang <weijie.yang@samsung.com>

Acked-by: Mel Gorman <mgorman@suse.de>

-- 
Mel Gorman
SUSE Labs

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

* Re: [PATCH V2 2/2] mm/vmscan: not check compaction_ready on promoted zones
@ 2014-02-14 11:04   ` Mel Gorman
  0 siblings, 0 replies; 4+ messages in thread
From: Mel Gorman @ 2014-02-14 11:04 UTC (permalink / raw)
  To: Weijie Yang
  Cc: 'Andrew Morton', riel, 'Minchan Kim',
	weijie.yang.kh, 'Linux-MM', 'linux-kernel'

On Fri, Feb 14, 2014 at 02:42:34PM +0800, Weijie Yang wrote:
> We abort direct reclaim if find the zone is ready for compaction.
> Sometimes the zone is just a promoted highmem zone to force scan
> pinning highmem, which is not the intended zone the caller want to
> alloc page from. In this situation, setting aborted_reclaim to
> indicate the caller turn back to retry allocation is waste of time
> and could cause a loop in __alloc_pages_slowpath().
> 
> This patch do not check compaction_ready() on promoted zones to avoid
> the above situation, only set aborted_reclaim if the caller intended
> zone is ready to compaction.
> 
> Acked-by: Rik van Riel <riel@redhat.com>
> Signed-off-by: Weijie Yang <weijie.yang@samsung.com>

Acked-by: Mel Gorman <mgorman@suse.de>

-- 
Mel Gorman
SUSE Labs

--
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] 4+ messages in thread

end of thread, other threads:[~2014-02-14 11:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14  6:42 [PATCH V2 2/2] mm/vmscan: not check compaction_ready on promoted zones Weijie Yang
2014-02-14  6:42 ` Weijie Yang
2014-02-14 11:04 ` Mel Gorman
2014-02-14 11:04   ` 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.