Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys



Module Name:    src
Committed By:   mjf
Date:           Tue Jun  1 22:13:30 UTC 2010

Modified Files:
        src/sys/arch/amd64/conf: kern.ldscript kern.ldscript.2MB
            kern.ldscript.Xen
        src/sys/arch/i386/conf: kern.ldscript
        src/sys/arch/sparc64/conf: kern.ldscript kern32.ldscript
        src/sys/modules/xldscripts: kmodule
        src/sys/net: if_gre.h
        src/sys/sys: cdefs_elf.h

Log Message:
Add __cacheline_aligned and __read_mostly annotations.

These annotations help to mitigate false sharing on multiprocessor
systems.

Variables annotated with __cacheline_aligned are placed into the
.data.cacheline_aligned section in the kernel. Each item in this
section is aligned on a cachline boundary - this avoids false
sharing. Highly contended global locks are a good candidate for
__cacheline_aligned annotation.

Variables annotated with __read_mostly are packed together tightly
into a .data.read_mostly section in the kernel. The idea here is that
we can pack infrequently modified data items into a cacheline and
avoid having to purge the cache, which would happen if read mostly
data and write mostly data shared a cachline. Initialisation variables
are a prime candiate for __read_mostly annotations.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amd64/conf/kern.ldscript
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amd64/conf/kern.ldscript.2MB \
    src/sys/arch/amd64/conf/kern.ldscript.Xen
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/conf/kern.ldscript
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sparc64/conf/kern.ldscript
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc64/conf/kern32.ldscript
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/xldscripts/kmodule
cvs rdiff -u -r1.39 -r1.40 src/sys/net/if_gre.h
cvs rdiff -u -r1.30 -r1.31 src/sys/sys/cdefs_elf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Home | Main Index | Thread Index | Old Index