linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] Remove redundant sched_numa_balancing check.
@ 2021-01-18 10:32 Imran Khan
  2021-01-18 10:57 ` Mel Gorman
  0 siblings, 1 reply; 3+ messages in thread
From: Imran Khan @ 2021-01-18 10:32 UTC (permalink / raw)
  To: mingo, peterz, vincent.guittot
  Cc: juri.lelli, dietmar.eggemann, rostedt, bsegall, mgorman, bristot,
	linux-kernel

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.

Signed-off-by: Imran Khan <imran.f.khan@oracle.com>
---
 kernel/sched/fair.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 04a3ce20da67..282ebd6c4197 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] Remove redundant sched_numa_balancing check.
  2021-01-18 10:32 [RFC PATCH] Remove redundant sched_numa_balancing check Imran Khan
@ 2021-01-18 10:57 ` Mel Gorman
  2021-01-18 19:13   ` Imran Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Mel Gorman @ 2021-01-18 10:57 UTC (permalink / raw)
  To: Imran Khan
  Cc: mingo, peterz, vincent.guittot, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, bristot, linux-kernel

On Mon, Jan 18, 2021 at 09:32:18PM +1100, Imran Khan wrote:
> 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.
> 
> Signed-off-by: Imran Khan <imran.f.khan@oracle.com>

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.

-- 
Mel Gorman
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] Remove redundant sched_numa_balancing check.
  2021-01-18 10:57 ` Mel Gorman
@ 2021-01-18 19:13   ` Imran Khan
  0 siblings, 0 replies; 3+ messages in thread
From: Imran Khan @ 2021-01-18 19:13 UTC (permalink / raw)
  To: Mel Gorman
  Cc: mingo, peterz, vincent.guittot, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, bristot, linux-kernel



On 18/1/21 9:57 pm, Mel Gorman wrote:
> On Mon, Jan 18, 2021 at 09:32:18PM +1100, Imran Khan wrote:
>> 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.
>>
>> Signed-off-by: Imran Khan <imran.f.khan@oracle.com>
> 
> 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.
> 

Okay, understood. Thanks for clarifying.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-18 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 10:32 [RFC PATCH] Remove redundant sched_numa_balancing check Imran Khan
2021-01-18 10:57 ` Mel Gorman
2021-01-18 19:13   ` Imran Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).