public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: WANG Xuerui <i.swmail@xen0n.name>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	WANG Xuerui <i.swmail@xen0n.name>,
	caiyinyu <caiyinyu@loongson.cn>,
	libc-alpha@sourceware.org, joseph_myers@mentor.com,
	carlos@redhat.com
Subject: Re: [PATCH v7 07/13] LoongArch: Linux Syscall Interface
Date: Wed, 27 Jul 2022 21:01:14 +0800	[thread overview]
Message-ID: <d0201006-d631-93e4-c7d1-38ef076b1392@xen0n.name> (raw)
In-Reply-To: <b55341c5-7b2c-4599-16e2-8f0f7e6768f8@linaro.org>


On 2022/7/27 19:16, Adhemerval Zanella Netto wrote:
>
> On 27/07/22 02:32, WANG Xuerui wrote:
>> On 2022/7/27 13:27, WANG Xuerui wrote:
>>> Wait. I almost missed this, glad I took an extra look before starting afternoon's $DAY_JOB work...
>>>
>>> On 2022/7/19 09:20, caiyinyu wrote:
>>>> |+#define VDSO_NAME "LINUX_2.6" +#define VDSO_HASH 61765110|
>>> |According to Linux sources [1], this should be "LINUX_5.10" instead, and the hash should be 182947696. The current value is for the old world and will lead to the vDSO being essentially wasted.
>>> |
>>>
>>> |To the Release Manager: do this need a proper patch, or if this can be fixed up in the branch pending inclusion? I can prepare one in short order if that's the proper way.
>>> |
>>>
>>> |[1]: https://github.com/torvalds/linux/blob/v5.19-rc8/arch/loongarch/vdso/vdso.lds.S#L59
>>> |
>>>
>>>
>> Ah. I just saw the branch merged in master.
>>
>> But a quick vdsotest shows the libc version's performance on par with correct vDSO calls:
>>
>> clock-gettime-monotonic: syscall: 183 nsec/call
>> clock-gettime-monotonic:    libc: 44 nsec/call
>> clock-gettime-monotonic:    vdso: 34 nsec/call
>> clock-getres-monotonic: syscall: 152 nsec/call
>> clock-getres-monotonic:    libc: 19 nsec/call
>> clock-getres-monotonic:    vdso: 14 nsec/call
>> clock-gettime-monotonic-coarse: syscall: 172 nsec/call
>> clock-gettime-monotonic-coarse:    libc: 39 nsec/call
>> clock-gettime-monotonic-coarse:    vdso: 29 nsec/call
>> clock-getres-monotonic-coarse: syscall: 154 nsec/call
>> clock-getres-monotonic-coarse:    libc: 18 nsec/call
>> clock-getres-monotonic-coarse:    vdso: 14 nsec/call
>> clock-gettime-monotonic-raw: syscall: 181 nsec/call
>> clock-gettime-monotonic-raw:    libc: 45 nsec/call
>> clock-gettime-monotonic-raw:    vdso: 36 nsec/call
>> clock-getres-monotonic-raw: syscall: 151 nsec/call
>> clock-getres-monotonic-raw:    libc: 19 nsec/call
>> clock-getres-monotonic-raw:    vdso: 14 nsec/call
>> clock-gettime-tai: syscall: 187 nsec/call
>> clock-gettime-tai:    libc: 44 nsec/call
>> clock-gettime-tai:    vdso: 34 nsec/call
>> clock-getres-tai: syscall: 151 nsec/call
>> clock-getres-tai:    libc: 19 nsec/call
>> clock-getres-tai:    vdso: 14 nsec/call
>> clock-gettime-boottime: syscall: 184 nsec/call
>> clock-gettime-boottime:    libc: 44 nsec/call
>> clock-gettime-boottime:    vdso: 34 nsec/call
>> clock-getres-boottime: syscall: 151 nsec/call
>> clock-getres-boottime:    libc: 19 nsec/call
>> clock-getres-boottime:    vdso: 14 nsec/call
>> clock-gettime-realtime: syscall: 181 nsec/call
>> clock-gettime-realtime:    libc: 44 nsec/call
>> clock-gettime-realtime:    vdso: 34 nsec/call
>> clock-getres-realtime: syscall: 151 nsec/call
>> clock-getres-realtime:    libc: 19 nsec/call
>> clock-getres-realtime:    vdso: 14 nsec/call
>> clock-gettime-realtime-coarse: syscall: 179 nsec/call
>> clock-gettime-realtime-coarse:    libc: 40 nsec/call
>> clock-gettime-realtime-coarse:    vdso: 29 nsec/call
>> clock-getres-realtime-coarse: syscall: 154 nsec/call
>> clock-getres-realtime-coarse:    libc: 18 nsec/call
>> clock-getres-realtime-coarse:    vdso: 14 nsec/call
>> getcpu: syscall: 134 nsec/call
>> getcpu:    libc: 20 nsec/call
>> getcpu:    vdso: 13 nsec/call
>> gettimeofday: syscall: 171 nsec/call
>> gettimeofday:    libc: 47 nsec/call
>> gettimeofday:    vdso: 33 nsec/call
>>
>> Which is getting interesting. (This may explain why nobody noticed before the merge.) I think we should still "fix" it, but at this point I'm starting to doubt whether it's a problem in the first place...
>>
> So does it this need to be fixed in the end? The numbers indicates that vDSO is indeed
> being used.

If striving for purity, the bug should definitely get fixed, but again I 
saw in sysdeps/unix/sysv/linux/dl-vdso.h that the dl_vdso_vsym makes use 
of dl_lookup_symbol_x, which states in its docstring:

 > Search loaded objects' symbol tables for a definition of the symbol 
UNDEF_NAME, perhaps with a requested version for the symbol.

I dug a little deeper but can't really verify the "perhaps" part, but 
judging from the doc alone the current behavior may well be expected. 
Maybe you or someone else more familiar with the details could enlighten 
me on this, but indeed vDSO must actually be effective for the 
order-of-magnitude improvement in numbers, hence the inconsistency 
should not be adversely affecting normal operation besides being a minor 
nuisance. We can fix it after 2.36 gets released then.


  reply	other threads:[~2022-07-27 13:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19  1:20 [PATCH v7 00/13] GLIBC LoongArch PATCHES caiyinyu
2022-07-19  1:20 ` [PATCH v7 01/13] LoongArch: Add LoongArch entries to config.h.in caiyinyu
2022-07-21 21:02   ` Adhemerval Zanella Netto
2022-07-19  1:20 ` [PATCH v7 02/13] LoongArch: Add relocations and ELF flags to elf.h and scripts/glibcelf.py caiyinyu
2022-07-21 21:02   ` Adhemerval Zanella Netto
2022-07-19  1:20 ` [PATCH v7 03/13] LoongArch: ABI Implementation caiyinyu
2022-07-20 12:29   ` Adhemerval Zanella Netto
2022-07-19  1:20 ` [PATCH v7 04/13] LoongArch: Thread-Local Storage Support caiyinyu
2022-07-20 14:34   ` Adhemerval Zanella Netto
2022-07-19  1:20 ` [PATCH v7 05/13] LoongArch: Generic <math.h> and soft-fp Routines caiyinyu
2022-07-20 13:04   ` Adhemerval Zanella Netto
2022-07-19  1:20 ` [PATCH v7 06/13] LoongArch: Atomic and Locking Routines caiyinyu
2022-07-20 14:32   ` Adhemerval Zanella Netto
2022-07-19  1:20 ` [PATCH v7 07/13] LoongArch: Linux Syscall Interface caiyinyu
2022-07-20 14:35   ` Adhemerval Zanella Netto
2022-07-27  5:27   ` WANG Xuerui
2022-07-27  5:32     ` WANG Xuerui
2022-07-27 11:16       ` Adhemerval Zanella Netto
2022-07-27 13:01         ` WANG Xuerui [this message]
2022-07-27 19:22           ` Adhemerval Zanella Netto
2022-07-19  1:20 ` [PATCH v7 08/13] LoongArch: Linux ABI caiyinyu
2022-07-20 16:37   ` Adhemerval Zanella Netto
2022-07-20 17:19 ` [PATCH v7 00/13] GLIBC LoongArch PATCHES Adhemerval Zanella Netto
2022-07-21  2:44   ` caiyinyu
2022-07-24  9:49 ` WANG Xuerui
2022-07-24 11:51   ` Xi Ruoyao
2022-07-24 12:02     ` WANG Xuerui
2022-07-25  8:21       ` caiyinyu
2022-07-25  8:28         ` Xi Ruoyao
2022-07-25  1:58     ` 刘振松
2022-07-25  8:01       ` Xi Ruoyao
2022-07-25 13:27   ` Adhemerval Zanella Netto
2022-07-25 14:14     ` caiyinyu
2022-07-26 12:35       ` caiyinyu
2022-07-26 12:42         ` Adhemerval Zanella Netto
2022-07-26 14:00           ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0201006-d631-93e4-c7d1-38ef076b1392@xen0n.name \
    --to=i.swmail@xen0n.name \
    --cc=adhemerval.zanella@linaro.org \
    --cc=caiyinyu@loongson.cn \
    --cc=carlos@redhat.com \
    --cc=joseph_myers@mentor.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).