From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4057459E8 for ; Sat, 21 Sep 2024 08:36:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FB8940041; Sat, 21 Sep 2024 08:36:38 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id EDB984003C for ; Sat, 21 Sep 2024 08:36:36 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-206aee4073cso30639925ad.1 for ; Fri, 20 Sep 2024 23:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726900596; x=1727505396; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vaNiX331dUviuGVwMHUqXix56FYdw0h88CTaw2d/Kiw=; b=WO6r8CtmNWldzPLVbDEiGDKyp5s7mWSTzuG/cXGYILa9S1wYktjwQE4x0AsS/unOS5 cSSrOj0KDTnauG3Um1Bk1HWTUFopuHThQSGcpQUciQbRAR7ITu7xJPyV7PUVQ7AunsLU XG8FZg8VJzoRBe47B4l3q4sTzsetxMHvoPM+QWz7TrZFlU9em3OeDUibBkN0SqCMWDLi gFp+zGEa6xd9MWE1pDReXo9UbwLMjJwOEyo/q0jWE5Q061x4H6G/iw8e7cwYJiM16+7U yMAmKclQ6ao4Ejl2bbUORIDSiU071cgSWP8XrdBebLkOwUe/1rrbCBJbNqx9bOcQERdp cFqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726900596; x=1727505396; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vaNiX331dUviuGVwMHUqXix56FYdw0h88CTaw2d/Kiw=; b=r/J6trqKCgcb1fLLy/c5C8rVexDIsHAmhqtZdZ4ONRelaSHGZmPaM50mq/vCih0A73 n+APW8HFujOXDkOdm3G4cafNriumZcfC8Y8C+qRQiiX50X4fYlIthuzt4k56xF1tz/+C ZoEp+ZkuqCtbXw2V2/oMoqxDW2Df8yRcp71reQ5rAg/2XD/4l72xuAsobz4aVCmn621z 7hK+XPK+keFQmFaR+miXcG0ZyiRrwz27R+84W3QdsVB02ZCh1qW6Upxd/pKLnDl5R6ff QaoMis91X1XUwjEckYMUOQvpKbxHXKKUefeM85tK10uVfz38yRCAo0p8repiWvPEGBZ/ Yzvw== X-Gm-Message-State: AOJu0YwP1X/zR3DvrGJcA0GkATQDc5HhLGJouPZ9xCEpP4/fcQPwP87v JVVUPA36KiBNIDNFt2xZtsMhuhIB/1tRmzlfbnQNwRuPK2RUvLoQD+yXMlJCbaQe3Y3YUcjeYUt D7+79C3Z19+iHK9ErSNU/sJpyqOE3zw== X-Google-Smtp-Source: AGHT+IERPgT/u1cCwb3A4WQ/GgjRIoyjpV7zCEAQTzVnATFCEWEFTOiiI+pIaH5Sr4SFtCPE9Zl714/cbcGsypbJmLI= X-Received: by 2002:a17:90b:4c8e:b0:2d8:b91d:d284 with SMTP id 98e67ed59e1d1-2dd80c1ada7mr7176089a91.16.1726900595898; Fri, 20 Sep 2024 23:36:35 -0700 (PDT) MIME-Version: 1.0 References: <20240919152148.45a19343@hermes.local> <20240920073916.2bc8f380@hermes.local> In-Reply-To: From: Isaac Boukris Date: Sat, 21 Sep 2024 09:36:24 +0300 Message-ID: Subject: Re: Accuracy of rte_get_tsc_hz() compared to linux To: Stephen Hemminger Cc: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org > > Really getting better value would require some sort of repeated check > > (maybe an alarm callback), and using cpu value as a starting point. > > In practically all my tests, on machines without tsc_known_freq, the > value determined by our linux estimation code with rounding lowered to > 1KHz, was much better (closer to kernel value, actually exact the > kernel value except one case where they differed in a couple of KHz). > What would repeated tests give us? I don't think the kernel value > changes, does it? Looking at the kernel code, there is a mention of a watchdog but it seems mostly disabled for TSC based on cpu flags (and it doesn't seem to change on the systems I'm testing). > In fact I think we should lower the rounding in our linux estimation > code to 1KHz (and its time from 100ms to 200ms, just to be on the safe > side, the kernel does a full second), as well as lower the rounding of > our common code to 1MHz. This will simply be more accurate. Increasing the test time to 200ms or even a full second doesn't seem to provide any improvement, so I'll keep it at 100ms and round it at 10KHz (close to the margin error).