diff mbox series

[08/29] mm: add FAULT_FLAG_SPECULATIVE flag

Message ID 20210430195232.30491-9-michel@lespinasse.org (mailing list archive)
State New, archived
Headers show
Series [01/29] mm: export dump_mm | expand

Commit Message

Michel Lespinasse April 30, 2021, 7:52 p.m. UTC
Define the new FAULT_FLAG_SPECULATIVE flag, which indicates when we are
attempting speculative fault handling (without holding the mmap lock).

Signed-off-by: Michel Lespinasse <michel@lespinasse.org>
---
 include/linux/mm.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Suren Baghdasaryan June 10, 2021, 12:58 a.m. UTC | #1
On Fri, Apr 30, 2021 at 12:52 PM Michel Lespinasse
<michel@lespinasse.org> wrote:
>
> Define the new FAULT_FLAG_SPECULATIVE flag, which indicates when we are
> attempting speculative fault handling (without holding the mmap lock).
>
> Signed-off-by: Michel Lespinasse <michel@lespinasse.org>
> ---
>  include/linux/mm.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 8ba434287387..021fdab5b721 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -434,6 +434,7 @@ extern pgprot_t protection_map[16];
>   * @FAULT_FLAG_REMOTE: The fault is not for current task/mm.
>   * @FAULT_FLAG_INSTRUCTION: The fault was during an instruction fetch.
>   * @FAULT_FLAG_INTERRUPTIBLE: The fault can be interrupted by non-fatal signals.
> + * @FAULT_FLAG_SPECULATIVE: The fault is handled without holding the mmap_sem.

nit: s/mmap_sem/mmap_lock

>   *
>   * About @FAULT_FLAG_ALLOW_RETRY and @FAULT_FLAG_TRIED: we can specify
>   * whether we would allow page faults to retry by specifying these two
> @@ -464,6 +465,7 @@ extern pgprot_t protection_map[16];
>  #define FAULT_FLAG_REMOTE                      0x80
>  #define FAULT_FLAG_INSTRUCTION                 0x100
>  #define FAULT_FLAG_INTERRUPTIBLE               0x200
> +#define FAULT_FLAG_SPECULATIVE                 0x400
>
>  /*
>   * The default fault flags that should be used by most of the
> @@ -501,7 +503,8 @@ static inline bool fault_flag_allow_retry_first(unsigned int flags)
>         { FAULT_FLAG_USER,              "USER" }, \
>         { FAULT_FLAG_REMOTE,            "REMOTE" }, \
>         { FAULT_FLAG_INSTRUCTION,       "INSTRUCTION" }, \
> -       { FAULT_FLAG_INTERRUPTIBLE,     "INTERRUPTIBLE" }
> +       { FAULT_FLAG_INTERRUPTIBLE,     "INTERRUPTIBLE" }, \
> +       { FAULT_FLAG_SPECULATIVE,       "SPECULATIVE" }
>
>  /*
>   * vm_fault is filled by the pagefault handler and passed to the vma's
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 8ba434287387..021fdab5b721 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -434,6 +434,7 @@  extern pgprot_t protection_map[16];
  * @FAULT_FLAG_REMOTE: The fault is not for current task/mm.
  * @FAULT_FLAG_INSTRUCTION: The fault was during an instruction fetch.
  * @FAULT_FLAG_INTERRUPTIBLE: The fault can be interrupted by non-fatal signals.
+ * @FAULT_FLAG_SPECULATIVE: The fault is handled without holding the mmap_sem.
  *
  * About @FAULT_FLAG_ALLOW_RETRY and @FAULT_FLAG_TRIED: we can specify
  * whether we would allow page faults to retry by specifying these two
@@ -464,6 +465,7 @@  extern pgprot_t protection_map[16];
 #define FAULT_FLAG_REMOTE			0x80
 #define FAULT_FLAG_INSTRUCTION  		0x100
 #define FAULT_FLAG_INTERRUPTIBLE		0x200
+#define FAULT_FLAG_SPECULATIVE			0x400
 
 /*
  * The default fault flags that should be used by most of the
@@ -501,7 +503,8 @@  static inline bool fault_flag_allow_retry_first(unsigned int flags)
 	{ FAULT_FLAG_USER,		"USER" }, \
 	{ FAULT_FLAG_REMOTE,		"REMOTE" }, \
 	{ FAULT_FLAG_INSTRUCTION,	"INSTRUCTION" }, \
-	{ FAULT_FLAG_INTERRUPTIBLE,	"INTERRUPTIBLE" }
+	{ FAULT_FLAG_INTERRUPTIBLE,	"INTERRUPTIBLE" }, \
+	{ FAULT_FLAG_SPECULATIVE,	"SPECULATIVE" }
 
 /*
  * vm_fault is filled by the pagefault handler and passed to the vma's