From c5f2f83a20231aba101889a7d5a4ea555f718f8b Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Wed, 23 Nov 2022 00:32:47 +0000 Subject: [PATCH] mm: rearrange fields in vm_area_struct to be more cache-friendly Move frequently accessed fields into the first cache line. Signed-off-by: Suren Baghdasaryan --- include/linux/mm_types.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index a05627f704ff..2b618d73ee26 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -455,6 +455,10 @@ struct vm_area_struct { #endif }; + unsigned long vm_flags; /* Flags, see mm.h. */ + + struct anon_vma *anon_vma; /* Serialized by page_table_lock */ + struct mm_struct *vm_mm; /* The address space we belong to. */ /* @@ -462,7 +466,6 @@ struct vm_area_struct { * See vmf_insert_mixed_prot() for discussion. */ pgprot_t vm_page_prot; - unsigned long vm_flags; /* Flags, see mm.h. */ /* * For areas with an address space and backing store, @@ -492,7 +495,6 @@ struct vm_area_struct { */ struct list_head anon_vma_chain; /* Serialized by mmap_lock & * page_table_lock */ - struct anon_vma *anon_vma; /* Serialized by page_table_lock */ /* Function pointers to deal with this struct. */ const struct vm_operations_struct *vm_ops; -- 2.50.1