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]
Message-ID: <4a40bcd9-f0ff-4fd5-19dc-e71961c3c4c6@redhat.com>
Date:   Wed, 17 Mar 2021 10:33:12 -0400
From:   Waiman Long <longman@...hat.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
        Ingo Molnar <mingo@...nel.org>,
        Davidlohr Bueso <dbueso@...e.de>, x86@...nel.org
Subject: Re: [tip: locking/urgent] locking/ww_mutex: Simplify use_ww_ctx &
 ww_ctx handling

On 3/17/21 10:10 AM, Waiman Long wrote:
> On 3/17/21 9:55 AM, Peter Zijlstra wrote:
>> On Wed, Mar 17, 2021 at 09:43:20AM -0400, Waiman Long wrote:
>>
>>> Using gcc 8.4.1, the generated __mutex_lock function has the same 
>>> size (with
>>> last instruction at offset +5179) with or without this patch. Well, 
>>> you can
>>> say that this patch is an no-op wrt generated code.
>> OK, then GCC has gotten better. Because back then I tried really hard
>> but it wouldn't remove the if (ww_ctx) branches unless I had that extra
>> const bool argument.
>>
> I think ww_mutex was merged in 2013. That is almost 8 years ago. It 
> could still be the case that older gcc compilers may not generate the 
> right code. I will try the RHEL7 gcc compiler (4.8.5) to see how it 
> fares. 

I got the same result with the 4.8.5 compiler. The __mutex_lock() 
function has the same size with or without the patch. Note that I used 
the debug config during my RHEL8 compiler test, so the generated code 
size is much larger. With the non-debug config that I used for the 4.8.5 
compiler test, the code is only about 1236 bytes.

Since the current Linux kernel requires gcc 4.9 or above (I downgraded 
the kernel to v5.4 for my 4.8.5 compiler test), the fear of generating 
inferior code due to this patch should be a moot point.

Cheers,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ