lkml.org 
[lkml]   [2021]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC PATCH 33/37] mm: enable speculative fault handling only for multithreaded user space
On Tue, Apr 06, 2021 at 06:44:58PM -0700, Michel Lespinasse wrote:
> + /* Only try spf for multithreaded user space faults. */

This comment is misleading ... mm_users will also be incremented for
ptraced programs as well as programs that are having their /proc/$pid/maps
examined, etc. Maybe:

/* No need to try spf for single-threaded programs */

Also, please, can we not use an acronym for this feature? It's not a
speculative page fault. The page fault is really happening. We're
trying to handle it under RCU protection (if anything the faultaround
code is the speculative page fault code ...) This is unlocked page
fault handling, perhaps?

> + if (!(flags & FAULT_FLAG_USER) || atomic_read(&mm->mm_users) == 1)
> + goto no_spf;
> +
> count_vm_event(SPF_ATTEMPT);
> seq = mmap_seq_read_start(mm);
> if (seq & 1)
> @@ -1351,6 +1355,7 @@ void do_user_addr_fault(struct pt_regs *regs,
>
> spf_abort:
> count_vm_event(SPF_ABORT);
> +no_spf:
>
> /*
> * Kernel-mode access to the user address space should only occur
> --
> 2.20.1
>
>

\
 
 \ /
  Last update: 2021-04-07 04:49    [W:0.507 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site