This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] hppa: Optimize atomic_compare_and_exchange_val_acq
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Helge Deller <deller at gmx dot de>, John David Anglin <dave dot anglin at bell dot net>, GNU C Library <libc-alpha at sourceware dot org>
- Cc: "deller at kernel dot org" <deller at kernel dot org>, Mike Frysinger <vapier at gentoo dot org>, Aurelien Jarno <aurelien at aurel32 dot net>
- Date: Tue, 27 Sep 2016 13:15:09 -0400
- Subject: Re: [PATCH] hppa: Optimize atomic_compare_and_exchange_val_acq
- Authentication-results: sourceware.org; auth=none
- References: <58B70052-B987-4C41-B603-F3AAB2FDE34B@bell.net> <85e42696-2979-c359-ac83-b6cc6a34bb67@redhat.com> <57E44F3E.1090907@gmx.de>
On 09/22/2016 05:38 PM, Helge Deller wrote:
> On 22.09.2016 22:37, Carlos O'Donell wrote:
>> On 09/22/2016 10:14 AM, John David Anglin wrote:
>>> The attached patch replaces the conditional branch tests in
>>> atomic_compare_and_exchange_val_acq with conditional instruction
>>> nullification. This avoids the stalls associated with conditional
>>> branches and the resulting code is shorter. There are no branches in
>>> the fast path when the operation is successful.
>>
>> Does this really make a measurable difference? The light-weight-syscall
>> is probably the most costly part of this entire operation.
>>
>> If you can show there is a measurable difference I would be willing
>> to accept the removal of the deadlock looping (it becomes a SIGILL
>> and you have to look at the core file).
>
> I'm with Dave that the removal of the deadlock looping is OK.
> There is no production kernel in real-life (e.g. Debian kernels) which
> return EDEADLOCK, because in the Linux kernel we have completely disabled
> the LWS debugging by default (ENABLE_LWS_DEBUG=0) and as such I see
> no kernel code path where EDEADLOCK can be returned.
Thanks.
--
Cheers,
Carlos.