From 76d56081355e70b9a7e8cabfa72153f106ca4a79 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 23 Jun 2021 19:46:11 +0200 Subject: [PATCH] Revert "mm: relocate 'write_protect_seq' in struct mm_struct" This reverts commit 2e3025434a6ba090c85871a1d4080ff784109e1f. It breaks the abi right now, but will come back in through the `android12-5.10` branch in the near future. Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: I5db1a5a7d6025c34528a57544928a89b2c2570b5 --- include/linux/mm_types.h | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 4398d84d2f8b..50648bc12864 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -468,6 +468,13 @@ struct mm_struct { */ atomic_t has_pinned; + /** + * @write_protect_seq: Locked when any thread is write + * protecting pages mapped by this mm to enforce a later COW, + * for instance during page table copying for fork(). + */ + seqcount_t write_protect_seq; + #ifdef CONFIG_MMU atomic_long_t pgtables_bytes; /* PTE page table pages */ #endif @@ -476,18 +483,6 @@ struct mm_struct { spinlock_t page_table_lock; /* Protects page tables and some * counters */ - /* - * With some kernel config, the current mmap_lock's offset - * inside 'mm_struct' is at 0x120, which is very optimal, as - * its two hot fields 'count' and 'owner' sit in 2 different - * cachelines, and when mmap_lock is highly contended, both - * of the 2 fields will be accessed frequently, current layout - * will help to reduce cache bouncing. - * - * So please be careful with adding new fields before - * mmap_lock, which can easily push the 2 fields into one - * cacheline. - */ struct rw_semaphore mmap_lock; struct list_head mmlist; /* List of maybe swapped mm's. These @@ -508,15 +503,7 @@ struct mm_struct { unsigned long stack_vm; /* VM_STACK */ unsigned long def_flags; - /** - * @write_protect_seq: Locked when any thread is write - * protecting pages mapped by this mm to enforce a later COW, - * for instance during page table copying for fork(). - */ - seqcount_t write_protect_seq; - spinlock_t arg_lock; /* protect the below fields */ - unsigned long start_code, end_code, start_data, end_data; unsigned long start_brk, brk, start_stack; unsigned long arg_start, arg_end, env_start, env_end;