lkml.org 
[lkml]   [2023]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv14 08/17] x86/mm: Reduce untagged_addr() overhead until the first LAM user
On Wed, Jan 11, 2023 at 03:37:27PM +0300, Kirill A. Shutemov wrote:

> #define __untagged_addr(untag_mask, addr) ({ \
> u64 __addr = (__force u64)(addr); \
> - s64 sign = (s64)__addr >> 63; \
> - __addr &= untag_mask | sign; \
> + if (static_branch_likely(&tagged_addr_key)) { \
> + s64 sign = (s64)__addr >> 63; \
> + __addr &= untag_mask | sign; \
> + } \
> (__force __typeof__(addr))__addr; \
> })
>
> #define untagged_addr(addr) __untagged_addr(current_untag_mask(), addr)

Is the compiler clever enough to put the memop inside the branch?

\
 
 \ /
  Last update: 2023-03-26 23:44    [W:0.181 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site