From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 4EC373858D33 for ; Wed, 8 Mar 2023 17:50:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4EC373858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x332.google.com with SMTP id e9-20020a056830200900b00694651d19f6so6532261otp.12 for ; Wed, 08 Mar 2023 09:50:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678297806; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=2ybKw4rRVQ0nMuNTe6UBwHTwhkobA+1tv2RYpZe8WSM=; b=Acz3W2NKfILKN/EOVduaeMmMSOaQeB8eZ0JkgsHFPOz4N1BFB2RaO5X7KxpJ0Oq6CB +RG9hLh/Ajc5zABbdHW9q8zxSqbZEXx6Y76hm9wOMfprWn2CwI5LLB+WHC/VuGrkbuoi g432AAGB2lcxYKsxD/jQsSgCM6fCs3oZMs6maTUch6pcRQ32korLiUICouCClCXP1UcZ n8M8L9Vk11BtdSlCgewAtBaAQChRIzl3Th9fKPtMnHEudZviX++z8jklsAjs+Pwc6c9Q cq4sTHEPzA9Jiy2OjC8+s8D7RbJtubwImFNhOMYZUftf0rAz0XUgq+alzYc151Yq1vw1 Bf2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678297806; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2ybKw4rRVQ0nMuNTe6UBwHTwhkobA+1tv2RYpZe8WSM=; b=gUmj1NIfWi5TCWEbukELbHbxuHQRFlUxoN4vepaveQnrK61hBNqHW7GjifVEGEH/+3 B6iooYw4YPu6c5bzOYRQo8jkQUL1+Q51PyFp+STUW+x3oFZB7fYmLU8YP7LnTVQUzYxs vMhur+VG4e8EiQaOtXGLJgevDzZMGHdnNe1OjUgWO++qh5yWKZfsXzjMvi9+bw32hwv0 feA3kHyu9S0F1u03Aq4GMXh4EdSw8hz/RTiIoSpBtMwa3LfVw6+RYApsCMlrnO0hP7Vi 8gpl09iHiJOl4ixTu86iCNVnoTbV/XOKWN/xF1M4n7hWo3BCrjVAMyJ6wiwUpPXtCHTy 9ixw== X-Gm-Message-State: AO0yUKXyvw8XBXW1FwZ9PZKlhqw3EqoRznn9PXFOSoETztmvK0KCIzmD eGiy+qmOihrK4GxRnR7muwojNg== X-Google-Smtp-Source: AK7set82YSRjKHzZX5uDH1myJCQXU5fLt3zt2biDQvQQSn5yKsQiBckm6gwVF7xfKyneOeKibz6j6w== X-Received: by 2002:a05:6830:43a1:b0:684:e812:caf with SMTP id s33-20020a05683043a100b00684e8120cafmr11968814otv.13.1678297806460; Wed, 08 Mar 2023 09:50:06 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c0:544b:655d:5559:758d:90f7? ([2804:1b3:a7c0:544b:655d:5559:758d:90f7]) by smtp.gmail.com with ESMTPSA id i12-20020a9d610c000000b0068664355604sm6762548otj.22.2023.03.08.09.50.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Mar 2023 09:50:05 -0800 (PST) Message-ID: Date: Wed, 8 Mar 2023 14:50:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] time: Use CLOCK_REALTIME for time (BZ #30200) Content-Language: en-US To: Bruno Haible , Florian Weimer , Paul Eggert Cc: libc-alpha@sourceware.org References: <20230306160321.2942372-1-adhemerval.zanella@linaro.org> <4301180.vrBl8dPDy9@nimes> <5788439.tzSfqdup6V@nimes> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <5788439.tzSfqdup6V@nimes> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 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,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 08/03/23 14:44, Bruno Haible wrote: > Adhemerval Zanella Netto wrote: >> ... all the trouble gnulib is pushing? > > The trouble does not originate in gnulib; it originate through the > use of inconsistent time APIs. Yes I understand it and I agree with that this inconsistency is not desirable, that exactly why I have sent this patch. The 'trouble' I meant all this boilerplate wrapper code you are adding on gnulib to 'fix' this glibc optimization. > > On a typical system, there are > - hundreds of programs that call gettimeofday() or timespec_get(), > - hundreds of programs that call time(). > Find attached the lists of programs in /usr/bin on my machine: > - 425 programs that call gettimeofday() or timespec_get(), > - 730 programs that call time(). > > Each time a program calls gettimeofday() or timespec_get(), and then, > within 1 to 3 milliseconds, a program (the same or a different one) > calls time(), there is the potential for trouble because the time > appears to go backwards. This trouble can occur with probability > between 0.1% and 0.3%, according to the data in > https://sourceware.org/bugzilla/show_bug.cgi?id=30200 . > > Gnulib attempts to reduce the trouble for specific programs, by > moving them from the "call time()" camp to the "call gettimeofday() or > timespec_get()" camp. > > Bruno >