[PATCH] time: Use CLOCK_REALTIME for time (BZ #30200)

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Tue Mar 7 11:57:50 GMT 2023



On 07/03/23 08:51, Florian Weimer wrote:
> * Adhemerval Zanella Netto:
> 
>>> And of those original 17 ns, quite a bit is overhead from the
>>> benchmarking loop.  I guess applications could work around it by having
>>> a background timer thread that increments a global variable and use that
>>> instead of the time function call, but that seems not a great approach.
>>
>> Yes, this is expected since time call will be route through clock_gettime.
>> Another fix would be to convince kernels developers to use CLOCK_REALTIME
>> on vDSO as well.
> 
> No, that won't help.  I think the crucial aspect for good x86-64
> performance is that by using the time entry point, we tell the kernel
> that it does not have to obtain microsecond or millisecond precision.
> 
>>> Based on previous feedback, I expect we'd have to carry a downstream
>>> revert of this patch indefinitely, so I'm rather strongly against
>>> applying it upstrean.
>>
>> To me it really seems like a over-optimization specially because 'time'
>> has only second resolution.
> 
> I'm afraid that this will impact logging performance significantly in
> some scenarios.

Alright, so I think we should close BZ#30200 as wontfix and state it is
done for performance reasons.


More information about the Libc-alpha mailing list