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 1350B459D6 for ; Thu, 19 Sep 2024 14:26:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8563D406FF; Thu, 19 Sep 2024 14:26:26 +0200 (CEST) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id 72DA8402B1 for ; Thu, 19 Sep 2024 14:26:24 +0200 (CEST) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2d8f06c2459so634076a91.0 for ; Thu, 19 Sep 2024 05:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726748783; x=1727353583; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rmtvVNxo1DlFS4nDVl3kgltqFhqNoME6bJEii2Uz/zs=; b=ccNrbePc6uIOHQ/MTLOYSemNCGr1b/N+SZZk1E+i1y212f3yZY0GRO3seTgLYHVFZW H3Rrt6DeDZqvcNZ8oA3oTYlNzwm2KNDiCkbo9kjAWPFilfdnduRQwRm5UiDVU0XsoIN0 39isYMENqSDuw9gdzthBH6lZ7j7wXWY6e1j2DgdRGsPUhqFibst0aEnHJL8xNyoxgyuN /Cgln+7AfsdakGe0QXoP53ZcFZkW1WM2B37NW/CVGTX68lrF+T3Vwu4XgcxkFDxgtMsr +Hd3hJWPjwi9DXqiOXtL0mxT0igebtVQxwriPkS1SqT2bxdIYrD98eSZxj5ho6i2cylx z98Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726748783; x=1727353583; h=content-transfer-encoding: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=rmtvVNxo1DlFS4nDVl3kgltqFhqNoME6bJEii2Uz/zs=; b=Wj/tbdLZ62HQJaPjCWVHntnvfVtDljFfZvleYf+DIRvIFebqWYINt8GAaNoYaxZB+I o+/RSFLJSapwo8YaoGcT9nfAw/foPBKQfMWKg+FR+tT8xb0nZW51GSwRhRblAfWg+syM FJNEcGVmQY4Zd+tgawPPhfQ/VSZc+h31PdrKL4YvYPnIUS9Fc+Tes15JDht3+IkagdrI oA1gcCSSV/ych3UYYSYzWeUH/5pKApw+V41Ld45ieVEXBkOtuRgul26D4nYk9F9i1lft o5S0epZKcr+/PKQr7DyWiF/bJm6he5v/rubgcTsdKw6ajrDfJahUJZgbvHbahngDfMYh ORFQ== X-Gm-Message-State: AOJu0YxUvGze8tTMOV4rBpLkkgvqdpPAvQIGF5YJWWWmmWE6Q3Q2wt7x 1TMKlSJruuWjaQdjSQKzx+S0Zy9IrAGsI4vpYKD5xu4NF7/rtfPNcr2YfnkYY3Ata716HEp2nVs I4g/O17nmWwCqB4zyeDUkzh1XEXM= X-Google-Smtp-Source: AGHT+IE5WuZZJ/3pxI7kA6NDCmU7JnQR54ZjvP48SsLxaHohI6Z+r2CFjmgFr2sxT1rOgS/PkPpyK1P6UT9GdhL/krc= X-Received: by 2002:a17:90a:ad8e:b0:2d8:c17b:5018 with SMTP id 98e67ed59e1d1-2dbb9dee8b8mr27657644a91.11.1726748783212; Thu, 19 Sep 2024 05:26:23 -0700 (PDT) MIME-Version: 1.0 References: <20240918162739.144ffd9d@hermes.local> In-Reply-To: <20240918162739.144ffd9d@hermes.local> From: Isaac Boukris Date: Thu, 19 Sep 2024 15:26:11 +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" Content-Transfer-Encoding: quoted-printable 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 On Thu, Sep 19, 2024 at 2:27=E2=80=AFAM Stephen Hemminger wrote: > > On Thu, 19 Sep 2024 01:04:40 +0300 > Isaac Boukris wrote: > > > I've run the helloworld application on an isolated cpu: > > taskset -c 10 ./dpdk-helloworld --log-level=3Dlib.eal:debug --no-huge > > > > The results are: > > EAL: TSC frequency arch ~2100000 KHz > > EAL: TSC frequency linux ~2095082 KHz > > EAL: TSC frequency estimate ~2095346 KHz > > > > The arch one is picked, which seems rather wrong, any way to override t= hat? > > Should we lower the estimation rounding to 1MHz or even 1KHz in the lin= ux one? > > > > Thoughts? Thanks! > > > > Kernel: 4.18.0-513.9.1.el8_9.x86_64 > > Note: 4.18 kernel was end of life 12 August 2018, I assume > this is RHEL8 which does their own backports and never changes kernel ver= sion. > > What is the kernel dmesg, why is it deciding on that value? Actually, this is the boot dmesg on the machine itself (the previous log was from a kvm on that machine). # journalctl -b --system | grep -i tsc Sep 15 17:50:16 localhost kernel: tsc: Detected 2100.000 MHz processor Sep 15 17:50:16 localhost kernel: TSC deadline timer available Sep 15 17:50:16 localhost kernel: clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x1e4530a99b6, max_idle_ns: 440795257976 ns Sep 15 17:50:16 localhost kernel: clocksource: Switched to clocksource tsc-= early Sep 15 17:50:16 localhost kernel: tsc: Refined TSC clocksource calibration: 2095.082 MHz Sep 15 17:50:16 localhost kernel: clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x1e330abbade, max_idle_ns: 440795251159 ns Sep 15 17:50:16 localhost kernel: clocksource: Switched to clocksource tsc So it looks like it is refined based on calibration, which we could do by preferring the linux estimation results over the arch (and lowering the rounding to 1MHz). Alternatively, maybe find a way to read the linux values or allow to set the value manually at init (as an eal param).