svn commit: r331404 - in head: cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/u...

Mateusz Guzik mjguzik at gmail.com
Fri Mar 23 02:36:43 UTC 2018


On Fri, Mar 23, 2018 at 3:15 AM, Alexander Motin <mav at freebsd.org> wrote:

> Author: mav
> Date: Fri Mar 23 02:15:05 2018
> New Revision: 331404
> URL: https://svnweb.freebsd.org/changeset/base/331404
>
> Log:
>   MFV r331400: 8484 Implement aggregate sum and use for arc counters
>
>   In pursuit of improving performance on multi-core systems, we should
>   implements fanned out counters and use them to improve the performance of
>   some of the arc statistics. These stats are updated extremely frequently,
>   and can consume a significant amount of CPU time.
>
>
>
>
Due to seriously fat locks this struct:

typedef struct aggsum_bucket {
        kmutex_t asc_lock;
        int64_t asc_delta;
        uint64_t asc_borrowed;
        uint64_t asc_pad[4]; /* pad out to cache line (64 bytes) */
} aggsum_bucket_t __aligned(CACHE_LINE_SIZE);

ends up using *two* cache lines. Without asc_pad the size is 48 bytes.
asc_pad adds 4 * 8 = 32 which pushes it to the next line for no good reason.

That said, I suggest #ifndefing it the field.

-- 
Mateusz Guzik <mjguzik gmail.com>


More information about the svn-src-head mailing list