This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][malloc] Avoid atomics in have_fastchunks
- From: DJ Delorie <dj at redhat dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: Wilco dot Dijkstra at arm dot com, libc-alpha at sourceware dot org, nd at arm dot com
- Date: Tue, 19 Sep 2017 13:42:06 -0400
- Subject: Re: [PATCH][malloc] Avoid atomics in have_fastchunks
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dj at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E829B7EA99
"Carlos O'Donell" <carlos@redhat.com> writes:
> You use unadorned loads and stores of the variable av->have_fastchunks, and
> this constitutes a data race which is undefined behaviour in C11.
I think the key here is to look at all accesses to that variable, and
consider "what's the worst that could happen if the wrong value is there
forever". If the worst case doesn't counter the benefits, it's a net
win.
Buy my biggest concern is wondering how long a "wrong value" can persist
and cause problems.