Re: [PATCH 5/6] sched/numa: Reset scan rate whenever task moves across nodes

From: Srikar Dronamraju
Date: Wed Sep 12 2018 - 11:19:28 EST


> > +#ifdef CONFIG_NUMA_BALANCING
> > + if (!p->mm || (p->flags & PF_EXITING))
> > + return;
> > +
> > + if (p->numa_faults) {
> > + int src_nid = cpu_to_node(task_cpu(p));
> > + int dst_nid = cpu_to_node(new_cpu);
> > +
> > + if (src_nid != dst_nid)
> > + p->numa_scan_period = task_scan_start(p);
> > + }
> > +#endif
>
> Please don't add #ifdeffery inside functions, especially not if they do weird flow control like
> a 'return' from the middle of a block.
>
> A properly named inline helper would work I suppose.
>

Okay, will take care.