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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Jul 2021 16:18:47 +0800
From:   Yunsheng Lin <linyunsheng@...wei.com>
To:     David Laight <David.Laight@...LAB.COM>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "mst@...hat.com" <mst@...hat.com>,
        "jasowang@...hat.com" <jasowang@...hat.com>
CC:     "nickhu@...estech.com" <nickhu@...estech.com>,
        "green.hu@...il.com" <green.hu@...il.com>,
        "deanbo422@...il.com" <deanbo422@...il.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "yury.norov@...il.com" <yury.norov@...il.com>,
        "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>,
        "ojeda@...nel.org" <ojeda@...nel.org>,
        "ndesaulniers@...ogle.com" <ndesaulniers@...ogle.com>,
        "joe@...ches.com" <joe@...ches.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linuxarm@...neuler.org" <linuxarm@...neuler.org>
Subject: Re: [PATCH v2 3/4] tools headers UAPI: add cpu_relax() implementation
 for x86 and arm64

On 2021/7/22 4:53, David Laight wrote:
> From: Yunsheng Lin
>> Sent: 20 July 2021 03:22
>>
>> As x86 and arm64 is the two available systems that I can build
>> and test the cpu_relax() implementation, so only add cpu_relax()
>> implementation for x86 and arm64, other arches can be added easily
>> when needed.
>>
> ...
>> +#if defined(__i386__) || defined(__x86_64__)
>> +/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
>> +static __always_inline void rep_nop(void)
>> +{
>> +	asm volatile("rep; nop" ::: "memory");
>> +}
> 
> Beware, Intel increased the stall for 'rep nop' in some recent
> cpu to IIRC about 200 cycles.
> 
> They even document that this might have a detrimental effect.
> It is basically far too long for the sort of thing it makes
> sense to busy-wait for.

Thanks for the info:)
I will be beware of that when playing with  'rep nop' in newer
x86 cpu.

> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ