Skip to contentSkip to conversation

mm: compact: fix zoneindex in compact

PATCH Applied Chen Feng 3 participants 7 messages May 19, 2016 – May 20, 2016

Subsystems (2)
lore
Share & tools
lore

Chen Feng

author
#0 lore raw

PATCH 1/1 mm: compact: fix zoneindex in compact

While testing the kcompactd in my platform 3G MEM only DMA ZONE. I found the kcompactd never wakeup. It seems the zoneindex has already minus 1 before. So the traverse here should be <=.

---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +1 -1
index 8fa2540..e5122d9 100644
@@ -1742,7 +1742,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
 	struct zone *zone;
 	enum zone_type classzone_idx = pgdat->kcompactd_classzone_idx;
 
-	for (zoneid = 0; zoneid < classzone_idx; zoneid++) {
+	for (zoneid = 0; zoneid <= classzone_idx; zoneid++) {
 		zone = &pgdat->node_zones[zoneid];
 
 		if (!populated_zone(zone))
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 3 lines · Chen Feng

While testing the kcompactd in my platform 3G MEM only DMA ZONE. I found the kcompactd never wakeup. It seems the zoneindex has already minus 1 before. So the traverse here should be <=.

Ouch, thanks!

Quoted 1 line
Fixes 0f87baf4f7fb ("mm: wake kcompactd before kswapd's short sleep")
Quoted 10 lines
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +0 -0
index 8fa2540..e5122d9 100644

mm/compaction.c static bool kcompactd_node_suitable(pg_data_t *pgdat) · line 1748

Quoted 8 lines
mm/compaction.c +1 -1
@@ -1742,7 +1742,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
 	struct zone *zone;
 	enum zone_type classzone_idx = pgdat->kcompactd_classzone_idx;
 
-	for (zoneid = 0; zoneid < classzone_idx; zoneid++) {
+	for (zoneid = 0; zoneid <= classzone_idx; zoneid++) {
 		zone = &pgdat->node_zones[zoneid];
 
 		if (!populated_zone(zone))

--
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
Quoted 10 lines · Vlastimil Babka
Quoted 3 lines · Chen Feng

While testing the kcompactd in my platform 3G MEM only DMA ZONE. I found the kcompactd never wakeup. It seems the zoneindex has already minus 1 before. So the traverse here should be <=.

Ouch, thanks!

Quoted 1 line
Fixes 0f87baf4f7fb ("mm: wake kcompactd before kswapd's short sleep")

Bah, not that one.

Fixes accf62422b3a ("mm, kswapd: replace kswapd compaction with waking

up kcompactd")

Quoted 19 lines
Quoted 16 lines
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +1 -1
index 8fa2540..e5122d9 100644
@@ -1742,7 +1742,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
 	struct zone *zone;
 	enum zone_type classzone_idx = pgdat->kcompactd_classzone_idx;
 
-	for (zoneid = 0; zoneid < classzone_idx; zoneid++) {
+	for (zoneid = 0; zoneid <= classzone_idx; zoneid++) {
 		zone = &pgdat->node_zones[zoneid];
 
Quoted 9 lines

mm/compaction.c static bool kcompactd_node_suitable(pg_data_t *pgdat) · line 1748

Quoted 2 lines
mm/compaction.c +0 -0
 		if (!populated_zone(zone))

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

--
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 32 lines · Vlastimil Babka
Quoted 10 lines · Vlastimil Babka
Quoted 3 lines · Chen Feng

While testing the kcompactd in my platform 3G MEM only DMA ZONE. I found the kcompactd never wakeup. It seems the zoneindex has already minus 1 before. So the traverse here should be <=.

Ouch, thanks!

Quoted 1 line
Fixes 0f87baf4f7fb ("mm: wake kcompactd before kswapd's short sleep")

Bah, not that one.

Fixes accf62422b3a ("mm, kswapd: replace kswapd compaction with waking

up kcompactd")

Quoted 15 lines
Quoted 12 lines
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +0 -0
index 8fa2540..e5122d9 100644
@@ -1742,7 +1742,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
 	struct zone *zone;
 	enum zone_type classzone_idx = pgdat->kcompactd_classzone_idx;
 
Quoted 5 lines
Quoted 5 lines

mm/compaction.c static bool kcompactd_node_suitable(pg_data_t *pgdat) · line 1748

Quoted 5 lines
mm/compaction.c +1 -1
-	for (zoneid = 0; zoneid < classzone_idx; zoneid++) {
+	for (zoneid = 0; zoneid <= classzone_idx; zoneid++) {
 		zone = &pgdat->node_zones[zoneid];
 
 		if (!populated_zone(zone))

Ignorant question: kcompactd_do_work() just below has a similar loop:
should that one be saying "zoneid <= cc.classzone_idx" too?

Hugh

--
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 33 lines · Hugh Dickins
Quoted 32 lines · Vlastimil Babka
Quoted 10 lines · Vlastimil Babka
Quoted 3 lines · Chen Feng

While testing the kcompactd in my platform 3G MEM only DMA ZONE. I found the kcompactd never wakeup. It seems the zoneindex has already minus 1 before. So the traverse here should be <=.

Ouch, thanks!

Quoted 1 line
Fixes 0f87baf4f7fb ("mm: wake kcompactd before kswapd's short sleep")

Bah, not that one.

Fixes accf62422b3a ("mm, kswapd: replace kswapd compaction with waking

up kcompactd")

Quoted 15 lines
Quoted 12 lines
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +0 -0
index 8fa2540..e5122d9 100644
@@ -1742,7 +1742,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
 	struct zone *zone;
 	enum zone_type classzone_idx = pgdat->kcompactd_classzone_idx;
 
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

mm/compaction.c static bool kcompactd_node_suitable(pg_data_t *pgdat) · line 1748

Quoted 5 lines
mm/compaction.c +1 -1
-	for (zoneid = 0; zoneid < classzone_idx; zoneid++) {
+	for (zoneid = 0; zoneid <= classzone_idx; zoneid++) {
 		zone = &pgdat->node_zones[zoneid];
 
 		if (!populated_zone(zone))

Ignorant question: kcompactd_do_work() just below has a similar loop:

You spelled "Important" wrong.

Quoted 1 line

should that one be saying "zoneid <= cc.classzone_idx" too?

Yes. Chen, can you send updated patch (also with the ack/cc/fixes tags I added?)

Thanks!

Quoted 2 lines

Hugh

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

author
#5 lore raw
Quoted 34 lines · Vlastimil Babka
Quoted 33 lines · Hugh Dickins
Quoted 32 lines · Vlastimil Babka
Quoted 10 lines · Vlastimil Babka
Quoted 3 lines · Chen Feng

While testing the kcompactd in my platform 3G MEM only DMA ZONE. I found the kcompactd never wakeup. It seems the zoneindex has already minus 1 before. So the traverse here should be <=.

Ouch, thanks!

Quoted 1 line
Fixes 0f87baf4f7fb ("mm: wake kcompactd before kswapd's short sleep")

Bah, not that one.

Fixes accf62422b3a ("mm, kswapd: replace kswapd compaction with waking

up kcompactd")

Quoted 15 lines
Quoted 12 lines
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +0 -0
index 8fa2540..e5122d9 100644
@@ -1742,7 +1742,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
 	struct zone *zone;
 	enum zone_type classzone_idx = pgdat->kcompactd_classzone_idx;
 
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

mm/compaction.c static bool kcompactd_node_suitable(pg_data_t *pgdat) · line 1748

Quoted 5 lines
mm/compaction.c +1 -1
-	for (zoneid = 0; zoneid < classzone_idx; zoneid++) {
+	for (zoneid = 0; zoneid <= classzone_idx; zoneid++) {
 		zone = &pgdat->node_zones[zoneid];
 
 		if (!populated_zone(zone))

Ignorant question: kcompactd_do_work() just below has a similar loop:

Yes, my mistake.

Quoted 6 lines

You spelled "Important" wrong.

Quoted 1 line

should that one be saying "zoneid <= cc.classzone_idx" too?

Yes. Chen, can you send updated patch (also with the ack/cc/fixes tags I added?)

OK, I will send it out soon.

Quoted 8 lines

Thanks!

Quoted 2 lines

Hugh

.

author
#6 lore raw
In reply to Vlastimil Babka
Quoted 42 lines · Vlastimil Babka
Quoted 33 lines · Hugh Dickins
Quoted 32 lines · Vlastimil Babka
Quoted 10 lines · Vlastimil Babka
Quoted 3 lines · Chen Feng

While testing the kcompactd in my platform 3G MEM only DMA ZONE. I found the kcompactd never wakeup. It seems the zoneindex has already minus 1 before. So the traverse here should be <=.

Ouch, thanks!

Quoted 1 line
Fixes 0f87baf4f7fb ("mm: wake kcompactd before kswapd's short sleep")

Bah, not that one.

Fixes accf62422b3a ("mm, kswapd: replace kswapd compaction with waking

up kcompactd")

Quoted 15 lines
Quoted 12 lines
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +0 -0
index 8fa2540..e5122d9 100644
@@ -1742,7 +1742,7 @@ static bool kcompactd_node_suitable(pg_data_t *pgdat)
 	struct zone *zone;
 	enum zone_type classzone_idx = pgdat->kcompactd_classzone_idx;
 
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

mm/compaction.c static bool kcompactd_node_suitable(pg_data_t *pgdat) · line 1748

Quoted 5 lines
mm/compaction.c +1 -1
-	for (zoneid = 0; zoneid < classzone_idx; zoneid++) {
+	for (zoneid = 0; zoneid <= classzone_idx; zoneid++) {
 		zone = &pgdat->node_zones[zoneid];
 
 		if (!populated_zone(zone))

Ignorant question: kcompactd_do_work() just below has a similar loop:

Quoted 6 lines

You spelled "Important" wrong.

Quoted 1 line

should that one be saying "zoneid <= cc.classzone_idx" too?

Yes. Chen, can you send updated patch (also with the ack/cc/fixes tags I added?)

kcompactd_do_work()

This fix already added by Andrew Morton <[email protected]>

I will not sent it.

Quoted 8 lines

Thanks!

Quoted 2 lines

Hugh

.