Remove redundant sched_numa_balancing check.
RFC PATCH 1/1 Remove redundant sched_numa_balancing check.
task_numa_fault is invoked from do_numa_page/do_huge_pmd_numa_page, for task_numa_work induced memory faults. task_numa_work is scheduled from task_tick_numa which is invoked only if sched_numa_balancing is true.
So task_numa_fault will not get invoked if sched_numa_balancing is false and hence we can avoid checking it again in task_numa_fault.
--- kernel/sched/fair.c | 3 --- 1 file changed, 3 deletions(-)
kernel/sched/fair.c +0 -3
@@ -2643,9 +2643,6 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags)struct numa_group *ng;int priv; -if (!static_branch_likely (&sched_numa_balancing)) -return ; -/* for example, ksmd faulting in a user's mm */ if (!p->mm)return ;
Signature · 1 line
2.25.1
Mel Gorman
reviewerQuoted 9 lines · Imran Khan
task_numa_faultis invoked from do_numa_page/do_huge_pmd_numa_page, fortask_numa_workinduced memory faults.task_numa_workis scheduled fromtask_tick_numawhich is invoked only ifsched_numa_balancingis true.So
task_numa_faultwill not get invoked ifsched_numa_balancingis false and hence we can avoid checking it again intask_numa_fault.Signed-off-by Imran Khan <[email protected]>
If NUMA balancing is disabled at runtime, there may still be PTEs that are marked for NUMA balancing. While these still get handled at fault, there is no point tracking the fault information in task_numa_fault and this function can still get called after sched_numa_balancing is disabled.
Signature · 2 lines
Mel Gorman SUSE Labs
Quoted 9 lines · Mel Gorman
Quoted 8 lines · Imran Khan
task_numa_faultis invoked from do_numa_page/do_huge_pmd_numa_page, fortask_numa_workinduced memory faults.task_numa_workis scheduled fromtask_tick_numawhich is invoked only ifsched_numa_balancingis true.So
task_numa_faultwill not get invoked ifsched_numa_balancingis false and hence we can avoid checking it again intask_numa_fault.
Quoted 8 lines
Quoted 1 line
Signed-off-by Imran Khan <[email protected]>If NUMA balancing is disabled at runtime, there may still be PTEs that are marked for NUMA balancing. While these still get handled at fault, there is no point tracking the fault information in
task_numa_faultand this function can still get called aftersched_numa_balancingis disabled.
Okay, understood. Thanks for clarifying.