On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd <adr...@freebsd.org> wrote: > On 24 October 2012 11:36, Jim Harris <jimhar...@freebsd.org> wrote: > >> Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. > > Ok, but.. > > >> struct mtx tdq_lock; /* run queue lock. */ >> + char pad[64 - sizeof(struct mtx)]; > > .. don't we have an existing compile time macro for the cache line > size, which can be used here?
Yes, but I didn't use it for a couple of reasons: 1) struct tdq itself is currently using __aligned(64), so I wanted to keep it consistent. 2) CACHE_LINE_SIZE is currently defined as 128 on x86, due to NetBurst-based processors having 128-byte cache sectors a while back. I had planned to start a separate thread on arch@ about this today on whether this was still appropriate. > > > Adrian _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"