Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp766140lqo; Fri, 10 May 2024 14:28:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUk0dH+qSjlngTLPDX83WvJAOYY3+4rMnCRMPLSeOIDZN8CXYZeMKE73X1qddkG4cxOndQuGtEup7xdXk9qhElhCWLB+HMWGzR7Zzo5/Q== X-Google-Smtp-Source: AGHT+IHBpwIO+9GdvwxtGWaWiGiGJdFmvXvSJ1MPix79fvtPsnLmXClsQy+eK0Do5JeLJE3MoRBo X-Received: by 2002:a05:6102:3f55:b0:47b:614e:cbd with SMTP id ada2fe7eead31-48077ea37c4mr4056626137.31.1715376494961; Fri, 10 May 2024 14:28:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715376494; cv=pass; d=google.com; s=arc-20160816; b=ErDWz2rtJ+2cHj2SIYb90OGBjSzq3BXXgoEK4kfNsDuszv5JgRL9ysciFP+9Cn1X+i bebJfiJkmecF8AwOyELBF63mVYICvwforjlVi0kJ4xSG7vZOKG2mF13S9hf4WzfnopLu K7xQtsa/zM3T1zq62UQteaYYPiOaVMMeqm2VI2vWmX0ueYeOuGx5HFCX3BmfLOrHRnMW /iEmWTwZxlGKTDO1uOoCCTg4cQJHC72JqNe7XcbhKbHhKYexVhiFIaRb+QVkeZV5znoF gj6XeXBfG3aNRTdSTqXLPWTl9lm8RUzkE2TOPIxs/0nrbPaIxBhdBgPobDaE5fpyr8T5 ZneA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=3q3hqpMGXKwiEL9x8u2/jKIHxeOXTBiBSvlvRi/TduI=; fh=fyZciHd/tIBkJJp+zWb80sZeMBBR5z2fI/VAI3NuC7w=; b=mktAc3Xf7Vy7yGpTcOsvQvs7XuuH90dxaBVg5/4ZBx2sQsPIjSVIYjF1MUb5n8esdh uqpOJcKALAj24RlNfEW+42FTUx5/QNqEt9A72KNUighZANOVXKkJyFqT6cEpwUkXLvkX fweANvGE7Lw8itw3tE0aBnx2yCq/5wnt4UeGYU31Kxef4OzBxtc2Kq6nAyuWwB/WdHmx Ak7v3Sp8A5vPC5J6iQTAix9u+R4YmlIua5vhYMWWYjwiZ5Sxkb3SvViE92rbzTcc9noA 9e/wWNGVqvSru+myyD1b4kilNzooTzzrqFyCyhW9S9Vp4QP8MZ8gwrOcJmKoFmH6vCFf pN4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="k/43edYX"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-176237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df54a117bsi47999051cf.56.2024.05.10.14.28.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 14:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="k/43edYX"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-176237-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C36BF1C21375 for ; Fri, 10 May 2024 21:28:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33CF813BAF7; Fri, 10 May 2024 21:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="k/43edYX" Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C41E13B783 for ; Fri, 10 May 2024 21:27:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715376479; cv=none; b=ml68TPMtIFQEuiGwpT4egHt4eG2qMIwYamBJOWe23FuMksvHUwGmGibVx9WK34dfMDpDSEXYM1T2tA8ko/SlbT+dIFd3kKTBDZsaVUbIQjIxlLP0wk1yM9WrjRdY6K2Er+b0Bp1ZVicGfG08BJs1tK8Fa7OuN3iMhwNejJnaTic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715376479; c=relaxed/simple; bh=jG1XzQGVqbPJVaV6zbgB4Vv73mJ0VYF0EnY5DNTHpfc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nPpvRx82hjsmu8/3D1+AwXuZW2rpE1s9V7nFRFI8a0qbnqweW9nxd5IueWytx24RZchfi8izMUCURxlSXjhE78nvayClA7QaL8hA1wA9JrgwApn3J9FVHQwqyQZ9P2hctNyainCUAyg3I1+rr2ceEUCnMhWS1imubDni0q0ca5k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=k/43edYX; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1ec92e355bfso23054095ad.3 for ; Fri, 10 May 2024 14:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715376477; x=1715981277; darn=vger.kernel.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=3q3hqpMGXKwiEL9x8u2/jKIHxeOXTBiBSvlvRi/TduI=; b=k/43edYX4lRVPreoWrJ1pG65IzPO5HYHH3wkGvwZ6byXewX4ES6DzaK9vLRAfHlKXq wmSnuvZeFKzC3d9TLc9nlDzAcpOszpIofkUrA+/3T7KmxNxc6SARxrM2KtCqP4ORO/zR Z9zpeGWFd7yr1MOxQ9Xdo4Yuc0645gzIs3q9SzBKs37uctNByDpI1I5BhwRjiOqe5Ayv ltxyUTZHmYDrwQ3bxiSUSutALv080hMKvBBXWXQz+owk/7DBaIcXQgIuQ6uoPrpIK695 WdmyY5zHeGAxCW1NNgxU42gpNtTSxAYIbm3B6JGazfMLYBYO/nUoDk8kebSfnh+udpxJ SD5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715376477; x=1715981277; 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=3q3hqpMGXKwiEL9x8u2/jKIHxeOXTBiBSvlvRi/TduI=; b=ux8Rc8uq+6Bx1PaSRhPdO8TLFTy94rO+Pmg6/r9LlNFqFTIqTGNBOz0og4OYNfAsDt fPfYzR3q7D0IXxYg+kRuvI9E/GjQzqXUIJw0BeE3zFF66fos3iERkM6Z0liuR/Vugs11 4F1EhOlrapHIZiAS7eOPCCUEJoqKbIIEKJTKSELzWPtW5FCbJnAJJTkhKmuOHYJref+W +SXB1f1RFaC4JM4sGYvDBEd6BaqEd23FM5Q8fyIXfURBstKNUu0hqPgzUkwwJNBT5Sh3 XVwru8KTbSIr8clCwum0s8Q+0HouqfnIi+7fHg4SwOA7CPw3yyzBUekqh7qgH1icPhIU ju3A== X-Forwarded-Encrypted: i=1; AJvYcCXMcGNUHEx2CPFdJV7UWM2XAgVKYYMBhaPbHyB/dZ/T2UR1yGeULC9NkbRYuc03btqdaykx2fyjWnB8VPc3qZ66zD7nE7OGcGhBrUHB X-Gm-Message-State: AOJu0Yzr3YVNRdQ0lUnL/c0bj5UgZLM1LkdaToLrprgrADz34llapBz5 axiJHV+ss8D7b0Hk22/91VYPcC8sdNKVIAdaxvzinmY5rwspWjRebocFFW8COjw8tfeO31FQjgr eDQ6G+dVEBna08zJvfeyvZAR8eybrDwoKmGFg X-Received: by 2002:a17:90a:fe93:b0:2b2:ce88:c68c with SMTP id 98e67ed59e1d1-2b6cc44fa08mr3718925a91.19.1715376477090; Fri, 10 May 2024 14:27:57 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240502211047.2240237-1-maheshb@google.com> <87fruspxgt.ffs@tglx> In-Reply-To: From: Yuliang Li Date: Fri, 10 May 2024 14:27:46 -0700 Message-ID: Subject: Re: [PATCHv4 net-next] ptp/ioctl: support MONOTONIC_RAW timestamps for PTP_SYS_OFFSET_EXTENDED To: =?UTF-8?B?TWFoZXNoIEJhbmRld2FyICjgpK7gpLngpYfgpLYg4KSs4KSC4KSh4KWH4KS14KS+4KSwKQ==?= Cc: Thomas Gleixner , Don Hatchett , Netdev , Linux , David Miller , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Richard Cochran , Arnd Bergmann , Sagi Maimon , Jonathan Corbet , John Stultz , Mahesh Bandewar Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you Mahesh. Please see my answers below. The mono_raw allows PHC to correlate with a non-adjusted time. This enables other types of clock sync algorithms to be developed. For example, if we want to measure the drift rate between CPU oscillator and PHC. We could run a linear regression over multiple pairs of . But if sys time itself is being adjusted (e.g., clock_realtime), the linear regression is running over a polyline hence less effective. With mono_raw, linear regression truly measures the drift rate of the CPU oscillator. This capability allows more types of clock sync algorithms to be developed. Thanks, Yuliang On Wed, May 8, 2024 at 7:54=E2=80=AFPM Mahesh Bandewar (=E0=A4=AE=E0=A4=B9= =E0=A5=87=E0=A4=B6 =E0=A4=AC=E0=A4=82=E0=A4=A1=E0=A5=87=E0=A4=B5=E0=A4=BE= =E0=A4=B0) wrote: > > On Wed, May 8, 2024 at 12:35=E2=80=AFAM Thomas Gleixner wrote: > > > > On Thu, May 02 2024 at 14:10, Mahesh Bandewar wrote: > > > The ability to read the PHC (Physical Hardware Clock) alongside > > > multiple system clocks is currently dependent on the specific > > > hardware architecture. This limitation restricts the use of > > > PTP_SYS_OFFSET_PRECISE to certain hardware configurations. > > > > > > The generic soultion which would work across all architectures > > > is to read the PHC along with the latency to perform PHC-read as > > > offered by PTP_SYS_OFFSET_EXTENDED which provides pre and post > > > timestamps. However, these timestamps are currently limited > > > to the CLOCK_REALTIME timebase. Since CLOCK_REALTIME is affected > > > by NTP (or similar time synchronization services), it can > > > experience significant jumps forward or backward. This hinders > > > the precise latency measurements that PTP_SYS_OFFSET_EXTENDED > > > is designed to provide. > > > > This is really a handwavy argument. > > > > Fact is that the time jumps of CLOCK_REALTIME caused by NTP (etc) are > > rare and significant enough to be easily filtered out. That's why this > > interface allows you to retrieve more than one sample. > > > > Can you please explain which problem you are actually trying to solve? > > > > It can't be PTP system time synchronization as that obviously requires > > CLOCK_REALTIME. > > > Let me add a couple of folks from the clock team. @Yuliang Li @Don Hatch= ett > I'm just a nomad-kernel-net guy trying to fill-in gaps :( > > > Thanks, > > > > tglx