Skip to contentSkip to conversation

Patch "mm/compaction.c: fix zoneindex in kcompactd()" has been added to the 4.6-stable tree

PATCH [email protected] 1 participant 1 message Jun 4, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mm/compaction.c: fix zoneindex in kcompactd()

to the 4.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mm-compaction.c-fix-zoneindex-in-kcompactd.patch
and it can be found in the queue-4.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 6cd9dc3e75078ef646076fa63adfb9b85ced0b66 Mon Sep 17 00:00:00 2001

From: Chen Feng <[email protected]>
Date: Fri, 20 May 2016 16:59:02 -0700
Subject: mm/compaction.c: fix zoneindex in kcompactd()

From: Chen Feng <[email protected]>

commit 6cd9dc3e75078ef646076fa63adfb9b85ced0b66 upstream.

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

It fixes a regression where kswapd could previously compact, but kcompactd not. Not a crash fix though.

[[email protected]: fix kcompactd_do_work() as well, per Hugh]
Fixes accf62422b3a ("mm, kswapd: replace kswapd compaction with waking up kcompactd")
Cc Hugh Dickins <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Zhuangluan Su <[email protected]>
Cc Yiping Xu <[email protected]>
---
 mm/compaction.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/compaction.c +2 -2
@@ -1742,7 +1742,7 @@ static bool kcompactd_node_suitable(pg_d
 	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))
@@ -1777,7 +1777,7 @@ static void kcompactd_do_work(pg_data_t
 							cc.classzone_idx);
 	count_vm_event(KCOMPACTD_WAKE);
 
-	for (zoneid = 0; zoneid < cc.classzone_idx; zoneid++) {
+	for (zoneid = 0; zoneid <= cc.classzone_idx; zoneid++) {
 		int status;
 
 		zone = &pgdat->node_zones[zoneid];

Patches currently in stable-queue which might be from [email protected] are

queue-4.6/mm-compaction.c-fix-zoneindex-in-kcompactd.patch