]> Git Repo - linux.git/commit
mm: fix cache coloring on x86_64 architecture
authorMichel Lespinasse <[email protected]>
Wed, 12 Dec 2012 00:01:56 +0000 (16:01 -0800)
committerLinus Torvalds <[email protected]>
Wed, 12 Dec 2012 01:22:25 +0000 (17:22 -0800)
commit7d025059650f1c41a427173789ac14b74212b361
tree5905f22f0ff11f96850d7caeec90c8ae898c6d47
parentf99024729e689f5de4534fde5400e3b035f068de
mm: fix cache coloring on x86_64 architecture

Fix the x86-64 cache alignment code to take pgoff into account.  Use the
x86 and MIPS cache alignment code as the basis for a generic cache
alignment function.

The old x86 code will always align the mmap to aliasing boundaries,
even if the program mmaps the file with a non-zero pgoff.

If program A mmaps the file with pgoff 0, and program B mmaps the file
with pgoff 1.  The old code would align the mmaps, resulting in misaligned
pages:

  A:  0123
  B:  123

After this patch, they are aligned so the pages line up:

  A: 0123
  B:  123

Proposed by Rik van Riel.

Signed-off-by: Michel Lespinasse <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/x86/kernel/sys_x86_64.c
This page took 0.052894 seconds and 4 git commands to generate.