Skip to contentSkip to conversation

mm/compaction: remove local variable is_lru

PATCH In review Ganesh Mahendran 4 participants 5 messages Jun 17, 2016 – Jun 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/compaction: remove local variable is_lru

local varialbe is_lru was used for tracking non-lru pages(such as balloon pages).

But commit
112ea7b668d3 ("mm: migrate: support non-lru movable page migration") introduced a common framework for non-lru page migration and moved the compound pages check before non-lru movable pages check.

So there is no need to use local variable is_lru.

---
 mm/compaction.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/compaction.c +1 -3
index fbb7b38..780be7f 100644
@@ -724,7 +724,6 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 
 	/* Time to isolate some pages for migration */
 	for (; low_pfn < end_pfn; low_pfn++) {
-		bool is_lru;
 
 		if (skip_on_failure && low_pfn >= next_skip_pfn) {
 			/*
@@ -807,8 +806,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 		 * It's possible to migrate LRU and non-lru movable pages.
 		 * Skip any other type of page
 		 */
-		is_lru = PageLRU(page);
-		if (!is_lru) {
+		if (!PageLRU(page)) {
 			/*
 			 * __PageMovable can return false positive so we need
 			 * to verify it under page_lock.
Signature · 7 lines
1.9.1

--
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>
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

local varialbe is_lru was used for tracking non-lru pages(such as balloon pages).

But commit
112ea7b668d3 ("mm: migrate: support non-lru movable page migration") introduced a common framework for non-lru page migration and moved the compound pages check before non-lru movable pages check.

Quoted 4 lines

So there is no need to use local variable is_lru.

---

Quoted 26 lines
 mm/compaction.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/compaction.c +1 -4
index fbb7b38..780be7f 100644
@@ -724,7 +724,6 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 
 	/* Time to isolate some pages for migration */
 	for (; low_pfn < end_pfn; low_pfn++) {
-		bool is_lru;
 
 		if (skip_on_failure && low_pfn >= next_skip_pfn) {
 			/*
@@ -807,8 +806,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 		 * It's possible to migrate LRU and non-lru movable pages.
 		 * Skip any other type of page
 		 */
-		is_lru = PageLRU(page);
-		if (!is_lru) {
+		if (!PageLRU(page)) {
 			/*
 			 * __PageMovable can return false positive so we need
 			 * to verify it under page_lock.
--
Quoted 1 line

1.9.1

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

#2 lore raw
In reply to Ganesh Mahendran
Quoted 5 lines · Ganesh Mahendran

local varialbe is_lru was used for tracking non-lru pages(such as balloon pages).

But commit
112ea7b668d3 ("mm: migrate: support non-lru movable page migration")

this commit sha is not stable because it is from the linux-next tree.

Quoted 6 lines

introduced a common framework for non-lru page migration and moved the compound pages check before non-lru movable pages check.

So there is no need to use local variable is_lru.

Other than that the patch looks ok and maybe it would be worth folding into the mm-migrate-support-non-lru-movable-page-migration.patch

Quoted 29 lines
---
 mm/compaction.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/compaction.c +1 -3
index fbb7b38..780be7f 100644
@@ -724,7 +724,6 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 
 	/* Time to isolate some pages for migration */
 	for (; low_pfn < end_pfn; low_pfn++) {
-		bool is_lru;
 
 		if (skip_on_failure && low_pfn >= next_skip_pfn) {
 			/*
@@ -807,8 +806,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 		 * It's possible to migrate LRU and non-lru movable pages.
 		 * Skip any other type of page
 		 */
-		is_lru = PageLRU(page);
-		if (!is_lru) {
+		if (!PageLRU(page)) {
 			/*
 			 * __PageMovable can return false positive so we need
 			 * to verify it under page_lock.
Signature · 1 line
1.9.1
Signature · 8 lines
Michal Hocko
SUSE Labs

--
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>
#3 lore raw
Quoted 12 lines · Michal Hocko
Quoted 5 lines · Ganesh Mahendran

local varialbe is_lru was used for tracking non-lru pages(such as balloon pages).

But commit
112ea7b668d3 ("mm: migrate: support non-lru movable page migration")

this commit sha is not stable because it is from the linux-next tree.

Quoted 3 lines

introduced a common framework for non-lru page migration and moved the compound pages check before non-lru movable pages check.

Quoted 6 lines
Quoted 3 lines

So there is no need to use local variable is_lru.

Other than that the patch looks ok and maybe it would be worth folding into the mm-migrate-support-non-lru-movable-page-migration.patch

Agreed.

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

#4 lore raw
Quoted 13 lines · Vlastimil Babka
Quoted 12 lines · Michal Hocko
Quoted 5 lines · Ganesh Mahendran

local varialbe is_lru was used for tracking non-lru pages(such as balloon pages).

But commit
112ea7b668d3 ("mm: migrate: support non-lru movable page migration")

this commit sha is not stable because it is from the linux-next tree.

Quoted 3 lines

introduced a common framework for non-lru page migration and moved the compound pages check before non-lru movable pages check.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

So there is no need to use local variable is_lru.

Other than that the patch looks ok and maybe it would be worth folding into the mm-migrate-support-non-lru-movable-page-migration.patch

Agreed.

Thanks.

Hi, Andrew:

Please help to fold this patch into:
mm-migrate-support-non-lru-movable-page-migration.patch

---