The child processes will inherit numa_pages_migrated and total_numa_faults from the parent. It means even if there is no numa fault happen on the child, the statistics in /proc/$pid of the child process might show huge amount. This is a bit weird. Let's initialize them when do fork.
Unified · Split
| @@ -2825,6 +2825,8 @@ void init_numa_balancing(unsigned long clone_flags, struct task_struct *p) · 2824 unmodified lines | ||
| 2825 | 2825 | /* Protect against double add, see task_tick_numa and task_numa_work */ |
| 2826 | 2826 | p->numa_work.next = &p->numa_work; |
| 2827 | 2827 | p->numa_faults = NULL; |
| 2828 | + p->numa_pages_migrated = 0; | |
| 2829 | + p->total_numa_faults = 0; | |
| 2828 | 2830 | RCU_INIT_POINTER(p->numa_group, NULL); |
| 2829 | 2831 | p->last_task_numa_placement = 0; |
| 2830 | 2832 | p->last_sum_exec_runtime = 0; |