[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <186d2d79-b7c2-4fab-8243-4c7080412074@suse.com>
Date: Thu, 30 May 2024 18:30:15 +0300
From: Nikolay Borisov <nik.borisov@...e.com>
To: Youling Tang <youling.tang@...ux.dev>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Mateusz Guzik <mjguzik@...il.com>, Youling Tang <tangyouling@...inos.cn>
Subject: Re: [PATCH 2/2] prefetch: Add ARCH_HAS_PREFETCH definition when the
architecture is not defined
On 29.05.24 г. 6:20 ч., Youling Tang wrote:
> From: Youling Tang <tangyouling@...inos.cn>
>
> After commit ab483570a13b ("x86 & generic: change to __builtin_prefetch()"), the
> __builtin_prefetch implementation will be used by default, so add its definition
> to return to a state similar to before commit[1].
I find those references to the past state somewhat confusing and not
really adding sustenance to the explanation.
>
> Currently prefetch_range() will be empty implemented under the x86_64 architecture,
> there was a concrete implementation before "x86 & generic: change to
> __builtin_prefetch()", so fix it.
Actually prefetch_range will be empty for every architecture which
doesn't defined ARCH_HAS_PREFETCH and since we have a working generic
fallback this indeed seems backwards. So defining ARCH_HAS_PREFETCH
makes sense.
Reviewed-by: Nikolay Borisov <nik.borisov@...e.com>
>
> No similar changes have been made to ARCH_HAS_PREFETCHW at this time.
>
> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/include/linux/prefetch.h?id=8e4f2fd31bf737abb392e694898a1496157623b5
>
> Fixes: ab483570a13b ("x86 & generic: change to __builtin_prefetch()")
> Signed-off-by: Youling Tang <tangyouling@...inos.cn>
> ---
> include/linux/prefetch.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h
> index b068e2e60939..162b7105e37c 100644
> --- a/include/linux/prefetch.h
> +++ b/include/linux/prefetch.h
> @@ -36,6 +36,7 @@ struct page;
> */
>
> #ifndef ARCH_HAS_PREFETCH
> +#define ARCH_HAS_PREFETCH
> #define prefetch(x) __builtin_prefetch(x)
> #endif
>
Powered by blists - more mailing lists