Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: add FAULT_FLAG_VMA_LOCK flag

Add a new flag to distinguish page faults handled under protection of
per-vma lock.

[surenb@google.com: document FAULT_FLAG_VMA_LOCK flag]
Link: https://lkml.kernel.org/r/20230301022720.1380780-2-surenb@google.com
Link: https://lore.kernel.org/all/20230301113648.7c279865@canb.auug.org.au/
Link: https://lkml.kernel.org/r/20230227173632.3292573-26-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Laurent Dufour <laurent.dufour@fr.ibm.com>
Cc: Dan Carpenter <error27@gmail.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Suren Baghdasaryan and committed by
Andrew Morton
55324e46 2ac0af1b

+4 -1
+2 -1
include/linux/mm.h
··· 479 479 { FAULT_FLAG_USER, "USER" }, \ 480 480 { FAULT_FLAG_REMOTE, "REMOTE" }, \ 481 481 { FAULT_FLAG_INSTRUCTION, "INSTRUCTION" }, \ 482 - { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" } 482 + { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" }, \ 483 + { FAULT_FLAG_VMA_LOCK, "VMA_LOCK" } 483 484 484 485 /* 485 486 * vm_fault is filled by the pagefault handler and passed to the vma's
+2
include/linux/mm_types.h
··· 1049 1049 * mapped after the fault. 1050 1050 * @FAULT_FLAG_ORIG_PTE_VALID: whether the fault has vmf->orig_pte cached. 1051 1051 * We should only access orig_pte if this flag set. 1052 + * @FAULT_FLAG_VMA_LOCK: The fault is handled under VMA lock. 1052 1053 * 1053 1054 * About @FAULT_FLAG_ALLOW_RETRY and @FAULT_FLAG_TRIED: we can specify 1054 1055 * whether we would allow page faults to retry by specifying these two ··· 1087 1086 FAULT_FLAG_INTERRUPTIBLE = 1 << 9, 1088 1087 FAULT_FLAG_UNSHARE = 1 << 10, 1089 1088 FAULT_FLAG_ORIG_PTE_VALID = 1 << 11, 1089 + FAULT_FLAG_VMA_LOCK = 1 << 12, 1090 1090 }; 1091 1091 1092 1092 typedef unsigned int __bitwise zap_flags_t;