On Fri, Mar 23, 2018 at 3:15 AM, Alexander Motin <m...@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>
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to