From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 5E806385AE43 for ; Thu, 28 Jul 2022 12:53:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5E806385AE43 Received: by mail-ot1-x32b.google.com with SMTP id g19-20020a9d1293000000b0061c7bfda5dfso1114281otg.1 for ; Thu, 28 Jul 2022 05:53:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=z44da0UUn+hLR0TGeDHKPaGXGy0rOp69RPUgp2/ASso=; b=TMlIqIy6vrT3rXD28u1cKqx/EwKEfOUbI5BM4nFkuXIaCc+ihKYpsZREePp/xd/EQR qMsXW48SpIsktuBop/iafdnc3WZVWz1xGhNFxtPu0Ggx4X3PjltEAYgr/BXXQGnW78XZ KXbEFqMOQLSnuS6cAlOUz9PBAewHqkr1d49vaTE1hS53iFYn7R/6YFPJ+MMi4FPM3oQp aN/lygm1RVbXM9xWp7DhJNVhin2mwSuRh4RmUZR9Km/X+Y1FdO9HbtB3KlfUrdSmwpJD qyzxeoMLPtU4yvN7nejgIBZHNjsywqEwRE0JW4ptIujNxJR6m7rWp6GAy7jMUTbMLxU3 7NsQ== X-Gm-Message-State: AJIora+rXBw/RaX3iTjlBs+rYggn0KFg09wwkReqs3fTZ+AQlhsjRd/n g8wHpqxabukRujJIsJQupfOu5w== X-Google-Smtp-Source: AGRyM1vil0mmMUQ6rssx6nOQr34sh5A1WZ/IzfkUqqW6s8pkjRBCDnh2WKueDIpmUb0QdyU83hb2VQ== X-Received: by 2002:a05:6830:1698:b0:61c:df3f:eb81 with SMTP id k24-20020a056830169800b0061cdf3feb81mr9744244otr.186.1659012822638; Thu, 28 Jul 2022 05:53:42 -0700 (PDT) Received: from ?IPV6:2804:431:c7cb:1e34:8c1:7b8a:41d4:61c7? ([2804:431:c7cb:1e34:8c1:7b8a:41d4:61c7]) by smtp.gmail.com with ESMTPSA id v22-20020a4ac916000000b0042573968646sm336658ooq.11.2022.07.28.05.53.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jul 2022 05:53:42 -0700 (PDT) Message-ID: Date: Thu, 28 Jul 2022 09:53:36 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH 0/3] GLIBC LOONGARCH PATCHES Content-Language: en-US To: caiyinyu , libc-alpha@sourceware.org, i.swmail@xen0n.name Cc: joseph_myers@mentor.com, carlos@redhat.com, xuchenghua@loongson.cn References: <20220728073009.2588790-1-caiyinyu@loongson.cn> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20220728073009.2588790-1-caiyinyu@loongson.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, SUBJ_ALL_CAPS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2022 12:53:46 -0000 On 28/07/22 04:30, caiyinyu wrote: > Hi: > > Considering binutils[1] (2eb132bdfb915) is ready I added vdso support for gettimeofday > back. > Is ifunc support backported to 2.28? Otherwise glibc gettimeout optimization will not work properly with minimum support binutils. > These patches are tested with gcc 12.0.1, Linux-5.19 [2]. > > I also tested vdso after I corrected the macros VDSO_NAME/VDSO_HASH, and the results[3] > are not good compared with Wang xuerui's tests[4]. > > BTW, there are little difference whether the macros VDSO_NAME/VDSO_HASH > are LINUX_5.10/182947696 or not. It seems that for vDSO resolution the version/hash is not really used (I will need check why exactly and if it really matters). In any case the gettimeofday raises some concern regarding binutils support, and it is also an optimization. So I think we should postpone it to 2.37, and we can backport if required. The VDSO_HASH/VDSO_NAME is ok for 2.36, it loongarch and follows that kernel exports. The greg_t and gregset_t is also ok for 2.36, I take the types are used on some project so we should fix it. > > [1] https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/master > > [2] Glibc test results: > XPASS: conform/UNIX98/ndbm.h/linknamespace > XPASS: conform/XOPEN2K/ndbm.h/linknamespace > XPASS: conform/XOPEN2K8/ndbm.h/linknamespace > XPASS: conform/XPG42/ndbm.h/linknamespace > UNSUPPORTED: crypt/cert > UNSUPPORTED: elf/tst-env-setuid > UNSUPPORTED: elf/tst-env-setuid-tunables > XPASS: elf/tst-protected1a > XPASS: elf/tst-protected1b > UNSUPPORTED: elf/tst-valgrind-smoke > UNSUPPORTED: misc/tst-adjtimex > UNSUPPORTED: misc/tst-clock_adjtime > UNSUPPORTED: misc/tst-ntp_adjtime > UNSUPPORTED: misc/tst-pkey > UNSUPPORTED: misc/tst-rseq > UNSUPPORTED: misc/tst-rseq-disable > UNSUPPORTED: nptl/test-cond-printers > UNSUPPORTED: nptl/test-condattr-printers > UNSUPPORTED: nptl/test-mutex-printers > UNSUPPORTED: nptl/test-mutexattr-printers > UNSUPPORTED: nptl/test-rwlock-printers > UNSUPPORTED: nptl/test-rwlockattr-printers > UNSUPPORTED: nptl/tst-rseq-nptl > UNSUPPORTED: stdlib/tst-secure-getenv > UNSUPPORTED: time/tst-clock_settime > UNSUPPORTED: time/tst-settimeofday > Summary of test results: > 4579 PASS > 20 UNSUPPORTED > 12 XFAIL > 6 XPASS > > [3] vdsotest-bench ( VDSO_NAME/VDSO_HASH -- LINUX_5.10/182947696 ): > clock-gettime-monotonic: syscall: 228 nsec/call > clock-gettime-monotonic: libc: 243 nsec/call > clock-gettime-monotonic: vdso: 239 nsec/call > clock-getres-monotonic: syscall: 196 nsec/call > clock-getres-monotonic: libc: 8 nsec/call > clock-getres-monotonic: vdso: 5 nsec/call > clock-gettime-monotonic-coarse: syscall: 218 nsec/call > clock-gettime-monotonic-coarse: libc: 25 nsec/call > clock-gettime-monotonic-coarse: vdso: 24 nsec/call > clock-getres-monotonic-coarse: syscall: 198 nsec/call > clock-getres-monotonic-coarse: libc: 8 nsec/call > clock-getres-monotonic-coarse: vdso: 4 nsec/call > clock-gettime-monotonic-raw: syscall: 228 nsec/call > clock-gettime-monotonic-raw: libc: 243 nsec/call > clock-gettime-monotonic-raw: vdso: 240 nsec/call > clock-getres-monotonic-raw: syscall: 197 nsec/call > clock-getres-monotonic-raw: libc: 8 nsec/call > clock-getres-monotonic-raw: vdso: 4 nsec/call > clock-gettime-tai: syscall: 231 nsec/call > clock-gettime-tai: libc: 246 nsec/call > clock-gettime-tai: vdso: 242 nsec/call > clock-getres-tai: syscall: 197 nsec/call > clock-getres-tai: libc: 8 nsec/call > clock-getres-tai: vdso: 4 nsec/call > clock-gettime-boottime: syscall: 229 nsec/call > clock-gettime-boottime: libc: 243 nsec/call > clock-gettime-boottime: vdso: 240 nsec/call > clock-getres-boottime: syscall: 196 nsec/call > clock-getres-boottime: libc: 8 nsec/call > clock-getres-boottime: vdso: 4 nsec/call > clock-gettime-realtime: syscall: 228 nsec/call > clock-gettime-realtime: libc: 242 nsec/call > clock-gettime-realtime: vdso: 239 nsec/call > clock-getres-realtime: syscall: 197 nsec/call > clock-getres-realtime: libc: 8 nsec/call > clock-getres-realtime: vdso: 5 nsec/call > clock-gettime-realtime-coarse: syscall: 227 nsec/call > clock-gettime-realtime-coarse: libc: 25 nsec/call > clock-gettime-realtime-coarse: vdso: 24 nsec/call > clock-getres-realtime-coarse: syscall: 198 nsec/call > clock-getres-realtime-coarse: libc: 7 nsec/call > clock-getres-realtime-coarse: vdso: 4 nsec/call > getcpu: syscall: 178 nsec/call > getcpu: libc: 179 nsec/call > getcpu: vdso: not tested > Note: vDSO version of getcpu not found > gettimeofday: syscall: 215 nsec/call > gettimeofday: libc: 226 nsec/call > gettimeofday: vdso: 226 nsec/call > > [4] Wang xuerui's vdsotest results: > 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 > > > caiyinyu (3): > LoongArch: Add vdso support for gettimeofday. > LoongArch: Fix VDSO_HASH and VDSO_NAME. > LoongArch: Add greg_t and gregset_t. > > .../unix/sysv/linux/loongarch/gettimeofday.c | 22 +++++++++++++++++++ > .../unix/sysv/linux/loongarch/sys/ucontext.h | 3 +++ > sysdeps/unix/sysv/linux/loongarch/sysdep.h | 5 +++-- > 3 files changed, 28 insertions(+), 2 deletions(-) > create mode 100644 sysdeps/unix/sysv/linux/loongarch/gettimeofday.c >