This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] login: pututline needs to validate the cache under write lock [BZ #24882]


* Adhemerval Zanella:

> On 21/08/2019 10:20, Florian Weimer wrote:
>> * Florian Weimer:
>> 
>>> 2019-08-12  Florian Weimer  <fweimer@redhat.com>
>>>
>>> 	[BZ #24882]
>>> 	* login/utmp_file.c (file_locking_failed): Report EAGAIN for a
>>> 	failure to acquire the lock.
>>> 	(internal_getut_nolock): New function.
>>> 	Extracted from internal_getut_r.
>>> 	(internal_getut_r): Call it.
>>> 	(__libc_pututline): Acquire write lock before all read operations.
>> 
>> It has been pointed out that this causes too much overhead with high
>> load.  Scanning entries using the read lock only is apparently important
>> for performance.
>
> So do you intend to resend a new version or this extra overhead is required
> to fully fix the issue?

I want to fix bug 24902 first:

  <https://sourceware.org/ml/libc-alpha/2019-08/msg00562.html>

This is probably the more relevant sources of stale cache entries, due
to the internal desynchronization of the cache contents and the file
offset.

I don't think it's expected that entries are repurposed during regular
use on utmp/utmpx files, particularly not with the glibc interfaces
(although one can always write to the files directly).

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]