Skip to content

Commit

Permalink
ARM: implement support for read-mostly sections
Browse files Browse the repository at this point in the history
As our SMP implementation uses MESI protocols.  Grouping together data
which is mostly only read together means that we avoid unnecessary
cache line bouncing when this code shares a cache line with other data.

In other words, cache lines associated with read-mostly data are
expected to spend most of their time in shared state.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Dec 5, 2010
1 parent 0b05da7 commit daf8741
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/include/asm/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
#define ARCH_SLAB_MINALIGN 8
#endif

#define __read_mostly __attribute__((__section__(".data..read_mostly")))

#endif
1 change: 1 addition & 0 deletions arch/arm/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ SECTIONS

NOSAVE_DATA
CACHELINE_ALIGNED_DATA(32)
READ_MOSTLY_DATA(32)

/*
* The exception fixup table (might need resorting at runtime)
Expand Down

0 comments on commit daf8741

Please sign in to comment.