aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRik van Riel <riel@surriel.com>2012-12-11 19:01:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 20:22:25 -0500
commite4c6bfd2d79d063017ab19a18915f0bc759f32d9 (patch)
tree4f97a0303f939a7846a86c7ade2533a8e2712f29
parent5a0768f641a5bad844860e67250baf0d1aa5e03c (diff)
mm: rearrange vm_area_struct for fewer cache misses
The kernel walks the VMA rbtree in various places, including the page fault path. However, the vm_rb node spanned two cache lines, on 64 bit systems with 64 byte cache lines (most x86 systems). Rearrange vm_area_struct a little, so all the information we need to do a VMA tree walk is in the first cache line. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Michel Lespinasse <walken@google.com> Signed-off-by: Rik van Riel <riel@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/mm_types.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 94fa52b28ee8..7ade2731b5d6 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -224,7 +224,8 @@ struct vm_region {
224 * library, the executable area etc). 224 * library, the executable area etc).
225 */ 225 */
226struct vm_area_struct { 226struct vm_area_struct {
227 struct mm_struct * vm_mm; /* The address space we belong to. */ 227 /* The first cache line has the info for VMA tree walking. */
228
228 unsigned long vm_start; /* Our start address within vm_mm. */ 229 unsigned long vm_start; /* Our start address within vm_mm. */
229 unsigned long vm_end; /* The first byte after our end address 230 unsigned long vm_end; /* The first byte after our end address
230 within vm_mm. */ 231 within vm_mm. */
@@ -232,9 +233,6 @@ struct vm_area_struct {
232 /* linked list of VM areas per task, sorted by address */ 233 /* linked list of VM areas per task, sorted by address */
233 struct vm_area_struct *vm_next, *vm_prev; 234 struct vm_area_struct *vm_next, *vm_prev;
234 235
235 pgprot_t vm_page_prot; /* Access permissions of this VMA. */
236 unsigned long vm_flags; /* Flags, see mm.h. */
237
238 struct rb_node vm_rb; 236 struct rb_node vm_rb;
239 237
240 /* 238 /*
@@ -245,6 +243,12 @@ struct vm_area_struct {
245 */ 243 */
246 unsigned long rb_subtree_gap; 244 unsigned long rb_subtree_gap;
247 245
246 /* Second cache line starts here. */
247
248 struct mm_struct *vm_mm; /* The address space we belong to. */
249 pgprot_t vm_page_prot; /* Access permissions of this VMA. */
250 unsigned long vm_flags; /* Flags, see mm.h. */
251
248 /* 252 /*
249 * For areas with an address space and backing store, 253 * For areas with an address space and backing store,
250 * linkage into the address_space->i_mmap interval tree, or 254 * linkage into the address_space->i_mmap interval tree, or