[PATCH] elf: Simplify software TM implementation in _dl_find_object
Florian Weimer
fweimer@redhat.com
Fri Jan 7 15:56:10 GMT 2022
* Szabolcs Nagy:
> The 01/07/2022 14:41, Florian Weimer wrote:
>> With the current set of fences, the version update at the start
>> of the TM write operation is redundant. Also use relaxed MO stores
>> during the dlclose update, and skip any version changes there.
>>
>> Suggested-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
>>
>> ---
>> Initial testing looks good, but I'll keep the aarch64 and powerpc64le
>> tests running in a loop for a while.
>
> looks good to me except
>
>> @@ -282,15 +279,6 @@ _dlfo_mappings_end_update (void)
>> atomic_thread_fence_release ();
>> __atomic_wide_counter_fetch_add_relaxed (&_dlfo_loaded_mappings_version, 1);
>> }
>
> i think the v += 1 does not have to be atomic so
>
> start_version = load_relaxed (&ver);
> store_relaxed (&ver, start_version + 1);
>
> or if we can change the api to pass start_version
> that may be clearer.
The 32-bit wide counter needs to be atomic. We can't use a straight
store in that case.
Should I break abstraction and write through for the 64-bit case?
Thanks,
Florian
More information about the Libc-alpha
mailing list