This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: mmap'ed robust mutexes and possible undefined behaviour
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: "Carlos O'Donell" <carlos at systemhalted dot org>
- Cc: Marcos Dione <mdione at grulic dot org dot ar>, "Carlos O'Donell" <carlos at redhat dot com>, "libc-help\ at sourceware dot org" <libc-help at sourceware dot org>
- Date: Wed, 26 Nov 2014 21:09:36 +0100
- Subject: Re: mmap'ed robust mutexes and possible undefined behaviour
- Authentication-results: sourceware.org; auth=none
- References: <20141124203441 dot GA3759 at diablo dot grulicueva dot local> <5473A7B0 dot 5050803 at redhat dot com> <87sih7t74c dot fsf at mid dot deneb dot enyo dot de> <87oarvt72u dot fsf at mid dot deneb dot enyo dot de> <20141125205649 dot GE3759 at diablo dot grulicueva dot local> <CAE2sS1iya7PpCK31mVVi-evHExBSn=z1h76ONGOaqf_BkSurgQ at mail dot gmail dot com>
* Carlos O'Donell:
> I don't object to someone implementing this in glibc, but I bet it
> will require coordination with the kernel to get right.
I agree. Currently, the robust list is processed by the kernel only
on thread exit (where it will be empty unless an abnormal condition
occurred), and doing so on every unmapping operation seems
unacceptable due to the performance overhead and the data structures
being used. The robust list layout is part of the userspace API, and
the kernel code has to deal with conconcurrent modifications
gracefully, so changes are invasive and need careful coordination.