Re: [PATCH v5 7/8] sched/numa: fix record hinting faults check

From: Mel Gorman
Date: Wed Dec 11 2013 - 05:15:15 EST


On Wed, Dec 11, 2013 at 05:41:56PM +0800, Wanpeng Li wrote:
> Hi Mel,
> On Wed, Dec 11, 2013 at 09:14:22AM +0000, Mel Gorman wrote:
> >On Wed, Dec 11, 2013 at 08:50:00AM +0800, Wanpeng Li wrote:
> >> Adjust numa_scan_period in task_numa_placement, depending on how much useful
> >> work the numa code can do. The local faults and remote faults should be used
> >> to check if there is record hinting faults instead of local faults and shared
> >> faults. This patch fix it.
> >>
> >> Reviewed-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>
> >> Signed-off-by: Wanpeng Li <liwanp@xxxxxxxxxxxxxxxxxx>
> >
> >This potentially has the side-effect of making it easier to reduce the
> >scan rate because it'll only take the most recent scan window into
> >account. The existing code takes recent shared accesses into account.
>
> The local/remote and share/private both accumulate the just finished
> scan window, why takes the most recent scan window into account will
> reduce the scan rate than takes recent shared accesses into account?
>

Ok, shoddy reasoning and explanation on my part. It was the second question
I really cared about -- was this tested? It wasn't and this patch is
surprisingly subtle.

The intent of the code was to check "is this processes recent activity
of interest to automatic numa balancing?"

If it's incurring local faults, then it's interesting.

If it's sharing faults then it is interesting. Shared accesses are
inherently dirty data because it is racing with other threads to be the
first to trap the hinting fault.

The current code takes those points into account and decides to slow
scanning on that basis. The change to using remote accesses is not
equivalent. The change is not necessarily better or worse because it's
workload dependant. It's just different and should be supported by more
detailed reasoning than either you or I are giving it right now. It could
also be argued that it should also be taking remote accesses into account
but again, it is a subtle patch that would require a bit of backup.

--
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/