From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4EC821F461 for ; Wed, 17 Jul 2019 08:23:47 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; q=dns; s=default; b=RMVY GgpDrj4KB9o7YpLImhcWsnkWF3O0xpxIy/vOfAMYJZSnZNJCWLWjiZIgf76/bUZc eVaYd1yPgkvZixRZu0CwIWLnSw+N+uOmn7dWCyUevS/3ephF0KC56S5DDdk2T8k5 Dyi9Jdhq51sgGIBCfPRp8Q+otTL8JAT4t3bwCdY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; s=default; bh=55bILliimM BfT4Nm6biqKuGSCpM=; b=DPLuR3SCYCiQAexCF5lBNHs0wGYZU2IfCGJbQTdyCA RkXW3GgOgRW2JtTz7R0EWBye1woeA9FeiT0SzEpSZuIXrjxeHzlFh7X2Kl6YUzec G/pEFOWmeu8i+CXreziQy4Xs99Cnr+tEDsdmrfhUscFCr91VgcGvCZRHIPbiNjKi U= Received: (qmail 112063 invoked by alias); 17 Jul 2019 08:23:44 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 112054 invoked by uid 89); 17 Jul 2019 08:23:44 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qt1-f193.google.com MIME-Version: 1.0 References: <0d116a8faab58db1952a256c6cb75e7b0f9af444.1563321715.git.alistair.francis@wdc.com> <87zhlddz8v.fsf@oldenburg2.str.redhat.com> <878ssxcc6p.fsf@oldenburg2.str.redhat.com> In-Reply-To: <878ssxcc6p.fsf@oldenburg2.str.redhat.com> From: Arnd Bergmann Date: Wed, 17 Jul 2019 10:23:25 +0200 Message-ID: Subject: Re: [RFC v3 05/23] sysdeps/timespec_get: Use clock_gettime64 if avaliable To: Florian Weimer Cc: Alistair Francis , GNU C Library , Adhemerval Zanella , Palmer Dabbelt , macro@wdc.com, Zong Li , Alistair Francis Content-Type: text/plain; charset="UTF-8" On Wed, Jul 17, 2019 at 10:12 AM Florian Weimer wrote: > * Arnd Bergmann: > > On Wed, Jul 17, 2019 at 7:08 AM Florian Weimer wrote: > >> * Alistair Francis: > > How important is this? It sounds like a micro-optimization for a case that > > very few people are going to hit, given that running an application with > > 64-bit time_t on an old kernel will likely hit other bugs that glibc cannot > > deal with. > > I don't think it's a microoptimization. On old kernels without > clock_gettime64 in the vDSO, 32-bit timespec_get will always make the > system call, which fails. Only then the 32-bit clock_gettime in the > vDSO is used. This effectively negates the performance benefit of the > vDSO, I think. I understand that it would be much slower on that particular combination, I just can't think of anyone who would run into this in practice outside of validation testing that makes sure glibc does run this way. If you have any real-world binary built with 64-bit time_t, this will require all library dependencies other than glibc to be built the same way and that in turn won't happen unless someone builds a whole distro for 64-bit time_t, which would be crazy unless they also use a modern kernel. I can understand the need to make it work in principle, but does it have to be efficient? Arnd