mm: rearrange fields in vm_area_struct to be more cache-friendly
authorSuren Baghdasaryan <surenb@google.com>
Wed, 23 Nov 2022 00:32:47 +0000 (00:32 +0000)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 4 Jan 2023 20:59:24 +0000 (15:59 -0500)
Move frequently accessed fields into the first cache line.

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
include/linux/mm_types.h

index a05627f704ff41b2c5178908d3c314a0464b5a51..2b618d73ee262a5bd625991030564de620e1a82d 100644 (file)
@@ -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;