Re: Cgroup memory barrier usage and call frequency from scheduler

From: Mel Gorman
Date: Thu Apr 09 2020 - 13:21:17 EST


On Thu, Apr 09, 2020 at 06:49:19PM +0200, Peter Zijlstra wrote:
> On Thu, Apr 09, 2020 at 04:44:13PM +0100, Mel Gorman wrote:
>
> > For 1, the use of a full barrier seems unnecessary when it appears that
> > you could have used a read barrier and a write barrier. The following
> > patch drops the profile overhead to 0.1%
>
> Yikes. And why still .1% the below should be a barrier() on x86. Is the
> compiler so contrained by that?
>

The 0.1% is still doing all the work up until just after the barrier with
this check;

if (cgroup_rstat_cpu(cgrp, cpu)->updated_next)
return;

That must often be true as samples were not gathered in the rest of the
function. As this function is called on every update_curr(), it gets
called a lot.

--
Mel Gorman
SUSE Labs