lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8335de39-024f-4be5-a69f-42949dbf7b33@redhat.com>
Date: Wed, 9 Apr 2025 11:25:13 +0200
From: David Hildenbrand <david@...hat.com>
To: Mateusz Guzik <mjguzik@...il.com>, dave.hansen@...ux.intel.com
Cc: linux-mm@...ck.org, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/mm: stop prefetching the mmap semaphore on page
 faults

On 01.04.25 16:35, Mateusz Guzik wrote:
> The prefetchw dates back decades and the fundamental notion of doing
> something like this on a lock is shady.
> 
> Moreover, for few years now in the fast path faults are handled with RCU
> + per-vma locking, hopefully not even looking at the lock to begin with.
> 
> As such just remove it.
> 
> I did not see a point benchmarking this. Given that it is not expected
> to be looked at by default justifies not doing the prefetch.
> 
> Signed-off-by: Mateusz Guzik <mjguzik@...il.com>
> ---
>   arch/x86/mm/fault.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> index 296d294142c8..697432f63c59 100644
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -13,7 +13,6 @@
>   #include <linux/mmiotrace.h>		/* kmmio_handler, ...		*/
>   #include <linux/perf_event.h>		/* perf_sw_event		*/
>   #include <linux/hugetlb.h>		/* hstate_index_to_shift	*/
> -#include <linux/prefetch.h>		/* prefetchw			*/
>   #include <linux/context_tracking.h>	/* exception_enter(), ...	*/
>   #include <linux/uaccess.h>		/* faulthandler_disabled()	*/
>   #include <linux/efi.h>			/* efi_crash_gracefully_on_page_fault()*/
> @@ -1496,8 +1495,6 @@ DEFINE_IDTENTRY_RAW_ERRORCODE(exc_page_fault)
>   
>   	address = cpu_feature_enabled(X86_FEATURE_FRED) ? fred_event_data(regs) : read_cr2();
>   
> -	prefetchw(&current->mm->mmap_lock);
> -
>   	/*
>   	 * KVM uses #PF vector to deliver 'page not present' events to guests
>   	 * (asynchronous page fault mechanism). The event happens when a

I'm sure if this would have any value, we'd get notified about it :)

Acked-by: David Hildenbrand <david@...hat.com>

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ