[RFC/PoC] malloc: use wfcqueue to speed up remote frees

Mathieu Desnoyers mathieu.desnoyers@efficios.com
Tue Jan 17 19:05:34 GMT 2023


On 2023-01-17 01:42, Eric Wong wrote:
> Carlos O'Donell <carlos@redhat.com> wrote:
>>>> - Adding urcu as a build-time dependency is not acceptable for
>>>> bootstrap, instead we would bundle a copy of urcu and keep it
>>>> in sync with upstream. Would that make your work easier?
>>
>> Eric Wong wrote:
>>> Yes, bundling that sounds great.  I assume it's something for
>>> you or one of the regular contributors to work on (build systems
>>> scare me :x)
>>
>> Yes, that is something we'd have to do.
> 
> Hi, bringing this topic from 2018 up again (+Cc Mathieu):
> https://inbox.sourceware.org/libc-alpha/c061de55-cc2a-88fe-564b-2ea9c4a7e632@redhat.com/T/
> 
> I'm wondering if URCU-in-glibc is still on the table.  I'm also
> considering an learning C11 atomics and deriving a standalone
> wfcqueue w/o URCU atomics.

Hi Eric,

I'm very much interested to contribute portions of liburcu to glibc. I 
think what we would need at this point is to document where we see that 
liburcu infrastructure can improve glibc, and create a gradual 
integration roadmap based on priorities. We should identify the 
stake-holders interested in seeing this done, and then we can discuss 
the time-frame and resources available for this project.

That being said, I suspect we'd want to cover a few pieces of technology 
in this list, namely:

- Restartable Sequences (rseq system call),
- membarrier system call,
- liburcu and libside [1,2] RCU implementations,
- liburcu data structures (e.g. wfcqueue).

I would be tempted to go for an approach closer to the RCU 
implementation I have done in the libside project for glibc, because it 
supports having multiple RCU grace period domains per process, which 
allows to nicely split the locking dependencies into sub-domains, and 
therefore lessen the chances of deadlocks due to nesting of a 
global-domain RCU read-side/synchronize_rcu, and locking (e.g. mutexes).

Thanks,

Mathieu

[1] https://github.com/efficios/libside/blob/master/src/rcu.c
[2] https://github.com/efficios/libside/blob/master/src/rcu.h

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com



More information about the Libc-alpha mailing list