Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5180256rwb; Wed, 17 Aug 2022 12:32:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pBg0SncnzUidziIOyYuNiLOoTGKzuoJQlxRnR6ltT91qTIhUvlVQRMscoTvEBIOvCrIl+ X-Received: by 2002:a17:902:7c05:b0:16e:e96c:e91e with SMTP id x5-20020a1709027c0500b0016ee96ce91emr28093140pll.89.1660764774599; Wed, 17 Aug 2022 12:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660764774; cv=none; d=google.com; s=arc-20160816; b=FUUH8jw8ShlRdFg6De1CVDgnbrc9AE1WzXty/asah5YZ3f/h3W4R6nVr513h/Z+o33 inKrBZhFLpE/xLsVukL67CvQD0tIpE2grXpvIZrdiP8BwwwTrQq2xb1SLO1Aj+L4v8uD b1rwfvVhsatv6JtVMu/MkbXBcvuasZnThvzFNaWKmVL/UpGOeElsDYbyx+431ObvuLdD 7/5XgzugWhiQhvYsJ6D+zDmPuPzaLRcb4WtVPyvsysNtf522jfIjso4oA8cabeDOfjty N8dvgAtEtqa/eHtfQZCufHykDjAN+X7Cke+YCrAhQDjgAinvdH5fCxgVbyFTzJMas0xC WayA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/GzfHt/awa+VK18jGGUko3L1h6Iqbe0pMW+4y3rFaK0=; b=BRqMqqSygGfqM5gUrasnLtvDjMQiYGUm09WU5EdcQPiCaE61NPvj3ued4T4jcqGDiQ 8DHNPQ4F3rmiyCHnj+R3K7EobTdtJvAJDBOfSB0pe4i1H6ALBaUQN6NKGtn9L6KDbRGV CYsgFly9N5kDeSIM/Ol2tUO+el0nlnjLWfolwQdBgtQegjmtxZp5qMWhaaRnD/57pxfI jUb8rqYupyxyhre0FAW1z64hDv6clwN0Tqo5ickFBoNuvCQZa/82K8huZjJr+UnxbR2x gfc5QKVeQoYL1DVmIPX/l7sAW0UHuMUH3/B2h+hs/iR89FCWyctEhDv/BFPTcsnRnuX4 TxSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=U90ttsaK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g123-20020a636b81000000b0041ce62de18esi17485867pgc.611.2022.08.17.12.32.40; Wed, 17 Aug 2022 12:32:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=U90ttsaK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238341AbiHQTVJ (ORCPT + 99 others); Wed, 17 Aug 2022 15:21:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240878AbiHQTVG (ORCPT ); Wed, 17 Aug 2022 15:21:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86D0DA3D7D; Wed, 17 Aug 2022 12:21:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1B26861449; Wed, 17 Aug 2022 19:21:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EC12C433D6; Wed, 17 Aug 2022 19:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1660764064; bh=bfu/fdYyxsHWCrdmUTDnABii7LLjy3aRYRRlbMf8hWc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U90ttsaKaUkHHdlnC1zVfXiCcM+BcJoiL2ov2ienR9q33S4p7J3q0KR1t1A3Pxlh+ tNWEX66hlEcZItzsNXWyuRfdNS6KDMYCOLT+m9YhuDEi0cKhw0R1NKFtMJ1yXkC3W0 dGXCRmrSrtLwy+NV6VQ1DhXEd762X1P4kVuKDkW4= Date: Wed, 17 Aug 2022 12:21:03 -0700 From: Andrew Morton To: Sergei Trofimovich Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org Subject: Re: [PATCH] ia64: fix clock_getre(CLOCK_MONOTONIC) to report ITC frequency Message-Id: <20220817122103.ecbd08bd545385e5bf8e0d72@linux-foundation.org> In-Reply-To: <20220815054944.4130786-1-slyich@gmail.com> References: <20220815054944.4130786-1-slyich@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Aug 2022 06:49:44 +0100 Sergei Trofimovich wr= ote: > clock_gettime(CLOCK_MONOTONIC, &tp) is very precise on ia64 as it uses > ITC (similar to rdtsc on x86). It's not quite a hrtimer as it is a few > times slower than 1ns. Usually 2-3ns. >=20 > clock_getres(CLOCK_MONOTONIC, &res) never reflected that fact and > reported 0.04s precision (1/HZ value). >=20 > In https://bugs.gentoo.org/596382 gstreamer's test suite failed loudly > when it noticed precision discrepancy. >=20 > Before the change: >=20 > clock_getres(CLOCK_MONOTONIC, &res) reported 250Hz precision. >=20 > After the change: >=20 > clock_getres(CLOCK_MONOTONIC, &res) reports ITC (400Mhz) precision. >=20 > The patch is based on matoro's fix. It adds a bit of explanation why we > need to special-case arch-specific clock_getres(). >=20 It would be best (and nice) to include the original developer's Signed-off-by: and to Cc =C9meric Maschino if possible? Could you please take care of these paperwork issues?