Page MenuHomeFreeBSD

libthr: Reorder pthread mutex to prevent false sharing
AcceptedPublic

Authored by aokblast on Wed, Oct 7, 7:25 AM.

Details

Reviewers
kib
markj
Summary

On a 64 byte cache line CPU (amd64), m_owner is contended by all of
the shared processes. However, after finding one winner, mtx is
enqueued, which trigger a cache refresh from other processors. Reorder
mtx so that m_lock and m_qu will not be in the same cache line.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 77802
Build 74685: arc lint + arc unit