Skip to content
Commit 249439d6 authored by Will Deacon's avatar Will Deacon Committed by Will Deacon
Browse files

BACKPORT: FROMGIT: mm: Move immutable fields of 'struct vm_fault' into anonymous struct



'struct vm_fault' contains both information about the fault being
serviced alongside mutable fields contributing to the state of the
fault-handling logic. Unfortunately, the distinction between the two is
not clear-cut, and a number of callers end up manipulating the structure
temporarily before restoring it when returning.

Try to clean this up by moving the immutable fault information into an
anonymous struct, which will later be marked as 'const'. Ideally, the
'flags' field would be part of the new structure too, but it seems as
though the ->page_mkwrite() path is not ready for this yet.

Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/CAHk-=whYs9XsO88iqJzN6NC=D-dp2m0oYXuOoZ=eWnvv=5OA+w@mail.gmail.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
Change-Id: If094fbaa416c31b7bf2d5b00f2474bd330a22cc5
Bug: 171278850
(cherry picked from commit 742d3372
https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=for-next/faultaround

)
[vinmenon: changes for speculative page fault]
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 895e8a64
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment