Skip to contentSkip to conversation

mm: init gfp mask in kcompactd_do_work()

PATCH In review Xishi Qiu 2 participants 3 messages Oct 10, 2016

Subsystems (2)
lore
Share & tools
lore

Xishi Qiu

author
#0 lore raw

PATCH 1/1 mm: init gfp mask in kcompactd_do_work()

We will use gfp_mask in the following path, but it's not init.

kcompactd_do_work
compact_zone
gfpflags_to_migratetype

However if not init, gfp_mask is always 0, and the result of gfpflags_to_migratetype(0) and gfpflags_to_migratetype(GFP_KERNEL) are the same, but it's a little confusion, so init it first.

---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +1 -1
index 9affb29..4b9a9d1 100644
@@ -1895,10 +1895,10 @@ static void kcompactd_do_work(pg_data_t *pgdat)
 	struct zone *zone;
 	struct compact_control cc = {
 		.order = pgdat->kcompactd_max_order,
+		.gfp_mask = GFP_KERNEL,
 		.classzone_idx = pgdat->kcompactd_classzone_idx,
 		.mode = MIGRATE_SYNC_LIGHT,
 		.ignore_skip_hint = true,
-
 	};
 	bool success = false;
 
Signature · 8 lines
1.8.3.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>
#1 lore raw
Quoted 9 lines · Xishi Qiu

We will use gfp_mask in the following path, but it's not init.

kcompactd_do_work
compact_zone
gfpflags_to_migratetype

However if not init, gfp_mask is always 0, and the result of gfpflags_to_migratetype(0) and gfpflags_to_migratetype(GFP_KERNEL) are the same, but it's a little confusion, so init it first.

Michal already did this as part of his patch, as it was needed to avoid wrongly restricting kcompactd to anonymous pages:

http://lkml.kernel.org/r/<[email protected]>

Quoted 12 lines
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +0 -0
index 9affb29..4b9a9d1 100644
@@ -1895,10 +1895,10 @@ static void kcompactd_do_work(pg_data_t *pgdat)
 	struct zone *zone;

mm/compaction.c static void kcompactd_do_work(pg_data_t *pgdat) · line 1904

Quoted 10 lines
mm/compaction.c +1 -1
 	struct compact_control cc = {
 		.order = pgdat->kcompactd_max_order,
+		.gfp_mask = GFP_KERNEL,
 		.classzone_idx = pgdat->kcompactd_classzone_idx,
 		.mode = MIGRATE_SYNC_LIGHT,
 		.ignore_skip_hint = true,
-
 	};
 	bool success = false;
 

--
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
#2 lore raw
Quoted 7 lines · Vlastimil Babka
Quoted 6 lines · Xishi Qiu

We will use gfp_mask in the following path, but it's not init.

kcompactd_do_work
compact_zone
gfpflags_to_migratetype

Quoted 8 lines
Quoted 3 lines

However if not init, gfp_mask is always 0, and the result of gfpflags_to_migratetype(0) and gfpflags_to_migratetype(GFP_KERNEL) are the same, but it's a little confusion, so init it first.

Michal already did this as part of his patch, as it was needed to avoid wrongly restricting kcompactd to anonymous pages:

http://lkml.kernel.org/r/<[email protected]>

Oh yes, I missed your discussion.

Thanks,
Xishi Qiu

Quoted 26 lines
Quoted 12 lines
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +0 -0
index 9affb29..4b9a9d1 100644
@@ -1895,10 +1895,10 @@ static void kcompactd_do_work(pg_data_t *pgdat)
     struct zone *zone;

mm/compaction.c static void kcompactd_do_work(pg_data_t *pgdat) · line 1904

Quoted 10 lines
mm/compaction.c +1 -1
     struct compact_control cc = {
         .order = pgdat->kcompactd_max_order,
+        .gfp_mask = GFP_KERNEL,
         .classzone_idx = pgdat->kcompactd_classzone_idx,
         .mode = MIGRATE_SYNC_LIGHT,
         .ignore_skip_hint = true,
-
     };
     bool success = false;
 

.