From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 474A3385040C for ; Mon, 12 Jul 2021 13:16:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 474A3385040C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-333-tDndmQAKOqSN9Wuz_uLbkQ-1; Mon, 12 Jul 2021 09:16:00 -0400 X-MC-Unique: tDndmQAKOqSN9Wuz_uLbkQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89604804317; Mon, 12 Jul 2021 13:15:57 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-103.rdu2.redhat.com [10.10.112.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3A325D9CA; Mon, 12 Jul 2021 13:15:56 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Linux: Use 32-bit vDSO for clock_gettime, gettimeofday, time (bug 28071) References: <87czrqf5un.fsf@oldenburg.str.redhat.com> <878s2ef19p.fsf@oldenburg.str.redhat.com> <874kd2ey6s.fsf@oldenburg.str.redhat.com> <158cdbcb-5335-9ff4-cf3e-a45d8603d029@linaro.org> <878s2bdddm.fsf@oldenburg.str.redhat.com> Date: Mon, 12 Jul 2021 15:15:54 +0200 In-Reply-To: (Adhemerval Zanella's message of "Mon, 12 Jul 2021 08:55:33 -0300") Message-ID: <87zgurad11.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 12 Jul 2021 13:16:03 -0000 * Adhemerval Zanella: > On 12/07/2021 07:40, Florian Weimer wrote: >> * Adhemerval Zanella: >> >>> Using the test (a slight modified one from the bug report): >>> >>> -- >>> #include >>> #include >>> #include >>> >>> int >>> main (void) >>> { >>> struct timespec ts; >>> errno = 0; >>> clock_gettime (CLOCK_REALTIME, &ts); >>> printf ("errno = %m (%d)\n", errno); >>> errno = 0; >>> clock_gettime (CLOCK_MONOTONIC, &ts); >>> printf ("errno = %m (%d)\n", errno); >>> } >>> -- >>> >>> I see no syscall on 5.11 kernel, only a clock_gettime (CLOCK_MONOTONIC) >>> on the 4.4 and a clock_gettime_time64 plus a clock_gettime on the 3.10. >> >> This still introduces a severe performance regression on older kernels. >> It may well make some exsting 32-bit applications unusable until the >> kernel is upgraded. I'm not sure if this is a good idea. >> >> At least I can see that the clobbering of errno is gone. > > Yes and this how we initially decided to provide 64-bit time_t support, > where 32-bit implementations are done on top of 64-bit ones. I am not > very fond of starting to adding 32-bit specific implementations, the > complexity to fix some specific cases do not really pay in the long > term imho. > > We might also add back the global time64 internal variable that indicates > if the kernel supports 64-bit (removed by 9465c3a9fb557), but it also has > its ow issues (live migration like CRIU). Hmm. I see. Let's fix the ENOSYS issue then because it breaks OpenJDK. I'm a bit surprised that we still see the extra syscalls with your patch, but I suppose that's just the way the INTERNAL_VSYSCALL_CALL macro works. Regarding the actual patch, there are a few missing spaces before parenthesis: + int (*vdso_time64)(clockid_t clock_id, struct __timespec64 *tp) + = GLRO(dl_vdso_clock_gettime64); + int (*vdso_time)(clockid_t clock_id, struct timespec *tp) + = GLRO(dl_vdso_clock_gettime); Thanks, Florian