All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] mm, compaction: determine isolation mode only once
@ 2014-03-07 12:01 ` David Rientjes
  0 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2014-03-07 12:01 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, Rik van Riel, Vlastimil Babka, Joonsoo Kim,
	linux-kernel, linux-mm

The conditions that control the isolation mode in 
isolate_migratepages_range() do not change during the iteration, so 
extract them out and only define the value once.

This actually does have an effect, gcc doesn't optimize it itself because 
of cc->sync.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/compaction.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -454,12 +454,13 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
 	unsigned long last_pageblock_nr = 0, pageblock_nr;
 	unsigned long nr_scanned = 0, nr_isolated = 0;
 	struct list_head *migratelist = &cc->migratepages;
-	isolate_mode_t mode = 0;
 	struct lruvec *lruvec;
 	unsigned long flags;
 	bool locked = false;
 	struct page *page = NULL, *valid_page = NULL;
 	bool skipped_async_unsuitable = false;
+	const isolate_mode_t mode = (!cc->sync ? ISOLATE_ASYNC_MIGRATE : 0) |
+				    (unevictable ? ISOLATE_UNEVICTABLE : 0);
 
 	/*
 	 * Ensure that there are not too many pages isolated from the LRU
@@ -592,12 +593,6 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
 			continue;
 		}
 
-		if (!cc->sync)
-			mode |= ISOLATE_ASYNC_MIGRATE;
-
-		if (unevictable)
-			mode |= ISOLATE_UNEVICTABLE;
-
 		lruvec = mem_cgroup_page_lruvec(page, zone);
 
 		/* Try isolate the page */

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

* [patch] mm, compaction: determine isolation mode only once
@ 2014-03-07 12:01 ` David Rientjes
  0 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2014-03-07 12:01 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, Rik van Riel, Vlastimil Babka, Joonsoo Kim,
	linux-kernel, linux-mm

The conditions that control the isolation mode in 
isolate_migratepages_range() do not change during the iteration, so 
extract them out and only define the value once.

This actually does have an effect, gcc doesn't optimize it itself because 
of cc->sync.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/compaction.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -454,12 +454,13 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
 	unsigned long last_pageblock_nr = 0, pageblock_nr;
 	unsigned long nr_scanned = 0, nr_isolated = 0;
 	struct list_head *migratelist = &cc->migratepages;
-	isolate_mode_t mode = 0;
 	struct lruvec *lruvec;
 	unsigned long flags;
 	bool locked = false;
 	struct page *page = NULL, *valid_page = NULL;
 	bool skipped_async_unsuitable = false;
+	const isolate_mode_t mode = (!cc->sync ? ISOLATE_ASYNC_MIGRATE : 0) |
+				    (unevictable ? ISOLATE_UNEVICTABLE : 0);
 
 	/*
 	 * Ensure that there are not too many pages isolated from the LRU
@@ -592,12 +593,6 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
 			continue;
 		}
 
-		if (!cc->sync)
-			mode |= ISOLATE_ASYNC_MIGRATE;
-
-		if (unevictable)
-			mode |= ISOLATE_UNEVICTABLE;
-
 		lruvec = mem_cgroup_page_lruvec(page, zone);
 
 		/* Try isolate the page */

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

* Re: [patch] mm, compaction: determine isolation mode only once
  2014-03-07 12:01 ` David Rientjes
@ 2014-03-07 12:27   ` Rik van Riel
  -1 siblings, 0 replies; 6+ messages in thread
From: Rik van Riel @ 2014-03-07 12:27 UTC (permalink / raw)
  To: David Rientjes, Andrew Morton
  Cc: Mel Gorman, Vlastimil Babka, Joonsoo Kim, linux-kernel, linux-mm

On 03/07/2014 07:01 AM, David Rientjes wrote:
> The conditions that control the isolation mode in 
> isolate_migratepages_range() do not change during the iteration, so 
> extract them out and only define the value once.
> 
> This actually does have an effect, gcc doesn't optimize it itself because 
> of cc->sync.
> 
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All rights reversed

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

* Re: [patch] mm, compaction: determine isolation mode only once
@ 2014-03-07 12:27   ` Rik van Riel
  0 siblings, 0 replies; 6+ messages in thread
From: Rik van Riel @ 2014-03-07 12:27 UTC (permalink / raw)
  To: David Rientjes, Andrew Morton
  Cc: Mel Gorman, Vlastimil Babka, Joonsoo Kim, linux-kernel, linux-mm

On 03/07/2014 07:01 AM, David Rientjes wrote:
> The conditions that control the isolation mode in 
> isolate_migratepages_range() do not change during the iteration, so 
> extract them out and only define the value once.
> 
> This actually does have an effect, gcc doesn't optimize it itself because 
> of cc->sync.
> 
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All rights reversed

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

* Re: [patch] mm, compaction: determine isolation mode only once
  2014-03-07 12:01 ` David Rientjes
@ 2014-03-10 15:29   ` Vlastimil Babka
  -1 siblings, 0 replies; 6+ messages in thread
From: Vlastimil Babka @ 2014-03-10 15:29 UTC (permalink / raw)
  To: David Rientjes, Andrew Morton
  Cc: Mel Gorman, Rik van Riel, Joonsoo Kim, linux-kernel, linux-mm

On 03/07/2014 01:01 PM, David Rientjes wrote:
> The conditions that control the isolation mode in
> isolate_migratepages_range() do not change during the iteration, so
> extract them out and only define the value once.
>
> This actually does have an effect, gcc doesn't optimize it itself because
> of cc->sync.
>
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>   mm/compaction.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -454,12 +454,13 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
>   	unsigned long last_pageblock_nr = 0, pageblock_nr;
>   	unsigned long nr_scanned = 0, nr_isolated = 0;
>   	struct list_head *migratelist = &cc->migratepages;
> -	isolate_mode_t mode = 0;
>   	struct lruvec *lruvec;
>   	unsigned long flags;
>   	bool locked = false;
>   	struct page *page = NULL, *valid_page = NULL;
>   	bool skipped_async_unsuitable = false;
> +	const isolate_mode_t mode = (!cc->sync ? ISOLATE_ASYNC_MIGRATE : 0) |
> +				    (unevictable ? ISOLATE_UNEVICTABLE : 0);
>
>   	/*
>   	 * Ensure that there are not too many pages isolated from the LRU
> @@ -592,12 +593,6 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
>   			continue;
>   		}
>
> -		if (!cc->sync)
> -			mode |= ISOLATE_ASYNC_MIGRATE;
> -
> -		if (unevictable)
> -			mode |= ISOLATE_UNEVICTABLE;
> -
>   		lruvec = mem_cgroup_page_lruvec(page, zone);
>
>   		/* Try isolate the page */
>


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

* Re: [patch] mm, compaction: determine isolation mode only once
@ 2014-03-10 15:29   ` Vlastimil Babka
  0 siblings, 0 replies; 6+ messages in thread
From: Vlastimil Babka @ 2014-03-10 15:29 UTC (permalink / raw)
  To: David Rientjes, Andrew Morton
  Cc: Mel Gorman, Rik van Riel, Joonsoo Kim, linux-kernel, linux-mm

On 03/07/2014 01:01 PM, David Rientjes wrote:
> The conditions that control the isolation mode in
> isolate_migratepages_range() do not change during the iteration, so
> extract them out and only define the value once.
>
> This actually does have an effect, gcc doesn't optimize it itself because
> of cc->sync.
>
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>   mm/compaction.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -454,12 +454,13 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
>   	unsigned long last_pageblock_nr = 0, pageblock_nr;
>   	unsigned long nr_scanned = 0, nr_isolated = 0;
>   	struct list_head *migratelist = &cc->migratepages;
> -	isolate_mode_t mode = 0;
>   	struct lruvec *lruvec;
>   	unsigned long flags;
>   	bool locked = false;
>   	struct page *page = NULL, *valid_page = NULL;
>   	bool skipped_async_unsuitable = false;
> +	const isolate_mode_t mode = (!cc->sync ? ISOLATE_ASYNC_MIGRATE : 0) |
> +				    (unevictable ? ISOLATE_UNEVICTABLE : 0);
>
>   	/*
>   	 * Ensure that there are not too many pages isolated from the LRU
> @@ -592,12 +593,6 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
>   			continue;
>   		}
>
> -		if (!cc->sync)
> -			mode |= ISOLATE_ASYNC_MIGRATE;
> -
> -		if (unevictable)
> -			mode |= ISOLATE_UNEVICTABLE;
> -
>   		lruvec = mem_cgroup_page_lruvec(page, zone);
>
>   		/* Try isolate the page */
>

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

end of thread, other threads:[~2014-03-10 15:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-07 12:01 [patch] mm, compaction: determine isolation mode only once David Rientjes
2014-03-07 12:01 ` David Rientjes
2014-03-07 12:27 ` Rik van Riel
2014-03-07 12:27   ` Rik van Riel
2014-03-10 15:29 ` Vlastimil Babka
2014-03-10 15:29   ` Vlastimil Babka

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.