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][BZ #16145] Reduce lock contention in __tz_convert()


On 24 Feb 2015 00:01, Mike Frysinger wrote:
> On 12 Feb 2015 00:37, Kevin Easton wrote:
> > This patch is an "easy win" partial fix for BZ #16145, which notes
> > the heavy contention on tzset_lock when multiple threads are converting
> > times with localtime_r().
> > 
> > In __tz_convert(), the lock does not need to be held after
> > __tzfile_compute() / __tz_compute() have been called, so we can move the
> > unlock up.  At this point there is still significant work to be done in
> > __offtime(), so we see some improvement (in my testing with 8 cores
> > banging on localtime_r(), ~20% improvement in throughput).
> 
> my reading of __offtime is that it only operates on its arguments (or const 
> global data like __mon_yday).  it also looks expensive, so maybe we should 
> hoist the remaining call outside of holding the lock ?  can you see if that'd 
> have any measurable improvement ?

i've pushed your patch as-is, but if you could vet this idea (since you 
already have benchmarks set up), that'd be great ...
-mike

Attachment: signature.asc
Description: Digital signature


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