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: [PATCHv2 2/4] Cleanup hp-timing defines



On 25/01/2019 14:18, Wilco Dijkstra wrote:
> v2: removes HP_TIMING_SMALL from elf/rtld.c
> 
> Cleanup the defines in the hp-timing header: Replace HP_TIMING_AVAIL
> with HP_TIMING_INLINE since these are equivalent.  Remove conflicting
> uses of HP_SMALL_TIMING_AVAIL and HP_TIMING_NONAVAIL.  Reserve
> HP_TIMING_NONAVAIL only for rtld internal timing. No functional changes
> (apart from not using rtld timing on alpha).
> 
> OK for commit?

I think since we are touching it, we should aim to clean up the hp-timing
usage not only for benchtests. Current internal hp-timing usage should be
aimed for time profiling and we can clean up its internal usage since:

  - clock_gettime, clock_settime, clock_getres, clock_nanosleep support
    for CLOCK_THREAD_CPUTIME_ID and CLOCK_PROCESS_CPUTIME_ID are not used
    neither on Linux nor on Hurd. It also means that assuming clock_*
    syscall always support such clock ids, pthread_clock_gettime.c
    and pthread_clock_settime.c are also unused. Which also leads to
    note that _dl_cpuclock_offset is also set and not used for none of
    the hp-timing architectures.

  - same for sysconf, where assuming CLOCK_THREAD_CPUTIME_ID and
    CLOCK_PROCESS_CPUTIME_ID support we can get rid of hp-timing usage.

  - the remaining 3 usages of hp-timing for some sort of randomness
    at resolv/res_mkquery.c, resolv/res_send.c, and sysdeps/posix/tempname.c
    could be replaced to clock_gettime (CLOCK_MONOTONIC) instead.
    If randomness is really required I think we should refactor to 
    use a better source (getrandom/getentropy).

Also, I understand why you refactor removes ld.so profiling for alpha
(since it is hp-timing support is sketchy at least and sit simplifies
the benchtests inclusion of generic implementation). However I think 
we can still maintain it supports by enable the architecture hp-timing 
support only for rtld.

Based on that I created a branch [1] with the above refactor along with
your suggestion to add a generic hp-timing based on clock_gettime. What
do you think?

[1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/master-hp-timing-refactor


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