Skip to contentSkip to conversation

sched/numa: expose per-task pages-migration-failure

PATCH RESEND In review 王贇 2 participants 3 messages Dec 3, 2019 Scheduler

lore
Share & tools
lore

王贇

author
#0 lore raw

PATCH RESEND 1/1 sched/numa: expose per-task pages-migration-failure

NUMA balancing will try to migrate pages between nodes, which could caused by memory policy or numa group aggregation, while the page migration could failed too for eg when the target node run out of memory.

Since this is critical to the performance, admin should know how serious the problem is, and take actions before it causing too much performance damage, thus this patch expose the counter as 'migfailed' in '/proc/PID/sched'.

---
 kernel/sched/debug.c | 1 +
 1 file changed, 1 insertion(+)
kernel/sched/debug.c +1 -0
index f7e4579e746c..73c4809c8f37 100644
@@ -848,6 +848,7 @@ static void sched_show_numa(struct task_struct *p, struct seq_file *m)
 	P(total_numa_faults);
 	SEQ_printf(m, "current_node=%d, numa_group_id=%d\n",
 			task_node(p), task_numa_group_id(p));
+	SEQ_printf(m, "migfailed=%lu\n", p->numa_faults_locality[2]);
 	show_numa_stats(p, m);
 	mpol_put(pol);
 #endif
Signature · 1 line
2.14.4.44.g2045bb6
#1 lore raw
Quoted 23 lines · 王贇

NUMA balancing will try to migrate pages between nodes, which could caused by memory policy or numa group aggregation, while the page migration could failed too for eg when the target node run out of memory.

Since this is critical to the performance, admin should know how serious the problem is, and take actions before it causing too much performance damage, thus this patch expose the counter as 'migfailed' in '/proc/PID/sched'.

---
 kernel/sched/debug.c | 1 +
 1 file changed, 1 insertion(+)
kernel/sched/debug.c +0 -0
index f7e4579e746c..73c4809c8f37 100644

kernel/sched/debug.c static void sched_show_numa(struct task_struct *p, struct seq_file *m) · line 851

Quoted 4 lines
kernel/sched/debug.c +1 -0
@@ -848,6 +848,7 @@ static void sched_show_numa(struct task_struct *p, struct seq_file *m)
 	P(total_numa_faults);
 	SEQ_printf(m, "current_node=%d, numa_group_id=%d\n",
 			task_node(p), task_numa_group_id(p));
+	SEQ_printf(m, "migfailed=%lu\n", p->numa_faults_locality[2]);

Any reason not to expose the other 2 fields of this array as well, which show remote/local migrations?

Thanks,

Ingo

author
#2 lore raw

On 2019/12/3 下午3:16, Ingo Molnar wrote:
[snip]

Quoted 15 lines

kernel/sched/debug.c static void sched_show_numa(struct task_struct *p, struct seq_file *m) · line 851

Quoted 12 lines
 kernel/sched/debug.c | 1 +
 1 file changed, 1 insertion(+)
kernel/sched/debug.c +1 -0
index f7e4579e746c..73c4809c8f37 100644
@@ -848,6 +848,7 @@ static void sched_show_numa(struct task_struct *p, struct seq_file *m)
 	P(total_numa_faults);
 	SEQ_printf(m, "current_node=%d, numa_group_id=%d\n",
 			task_node(p), task_numa_group_id(p));
+	SEQ_printf(m, "migfailed=%lu\n", p->numa_faults_locality[2]);

Any reason not to expose the other 2 fields of this array as well, which show remote/local migrations?

The rest are local/remote faults counter, AFAIK not related to migration, when the CPU triggered PF is from the same node of page (before migration), local faults increased.

Regards,
Michael Wang

Quoted 5 lines

Thanks,

Ingo