This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH][BZ 18743] PowerPC: Fix a race condition when eliding a lock
- From: Torvald Riegel <triegel at redhat dot com>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Cc: "Carlos O'Donell" <carlos at redhat dot com>, libc-alpha at sourceware dot org, munroesj at linux dot vnet dot ibm dot com
- Date: Mon, 03 Aug 2015 18:28:48 +0200
- Subject: Re: [PATCH][BZ 18743] PowerPC: Fix a race condition when eliding a lock
- Authentication-results: sourceware.org; auth=none
- References: <1438274936-26493-1-git-send-email-tuliom at linux dot vnet dot ibm dot com> <55BAEE77 dot 9000501 at redhat dot com> <87lhdw1hri dot fsf at totoro dot lan>
On Fri, 2015-07-31 at 12:14 -0300, Tulio Magno Quites Machado Filho
> "Carlos O'Donell" <email@example.com> writes:
> > On 07/30/2015 12:48 PM, Tulio Magno Quites Machado Filho wrote:
> >> Note: this patch is updating the NEWS section of glibc 2.22 because that's the
> >> only one available right now. Whether this patch will end up in glibc 2.23
> >> or 2.22 has to be defined.
> > No for 2.22. Please work on 2.23.
> > You will need to describe in much more detail exactly what synchronization
> > you are using to ensure that this is race-free now.
> In fact, I'm using the same mechanism already available. I'm just adding
> another step inside the critical path.
> But I'll improve my commit message and the comments in the code.
> > If there is any synchronization going on with HTM we need a way to describe
> > that synchronization and document the concurrency aspect of the change. It
> > is the only way we'll remember what we did when we come back to look at this
> > code in 1, 2, 5, 10 years.
I also think using relaxed-MO atomic operations inside the transactions
is better for accesses to data that is accessed concurrently outside of
transactions too. The HW txn will ensure atomicity and thus there's no
difference no matter what code the compiler generates *inside* of a
transaction (it shouldn't generally move past txn boundaries, of
course). Nonetheless, using atomic accesses will improve clarity of the