svn commit: r323393 - in head/sys: sys vm

Mateusz Guzik mjguzik at gmail.com
Fri Sep 22 13:25:08 UTC 2017


On Thu, Sep 14, 2017 at 12:32 AM, Gleb Smirnoff <glebius at freebsd.org> wrote:

> On Mon, Sep 11, 2017 at 09:30:10AM +0200, Mateusz Guzik wrote:
> M> First, there is a bunch of counter(9) fields. I don't know the original
> M> reasoning. I would expect these counters to be statically defined in a
> M> per-cpu struct.
>
> The reasoning was to remove 'struct vmmeter' from the 'struct pcpu', which
> sounds inline with your desire to remote struct vmmeter from the kernel
> at all.
>
> Maintainance wise, it is much easier not to bloat 'struct pcpu' with
> various global statistics, but keep them as counter(9)s instead. Indeed,
> what's the big difference between TCP statistics and VM statistics, why
> treat them differently?
>
> Performance wise, I haven't seen any regressions when collapsed
> multiple entities of struct vmmeter sitting in struct pcpu, into
> single one with counter(9)s.
>

My general point is that low-level primitives are weirdly heavier than
they need to be. Notable example is critical_enter/exit which are both
function calls.

As for counter(9), it adds an avoidable read. You are not going to measure
the impact as it is due to the kernel being rather pessimized in general.
pmc
will probably show slight increase in cache misses, but that's it.

That said, if maintenance is easier (I don't see why though) that's fine,
I'm
definitely not interested in fighting over this one.

-- 
Mateusz Guzik <mjguzik gmail.com>


More information about the svn-src-all mailing list