Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1649724rdb; Mon, 2 Oct 2023 17:13:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3j7LPLP9THIb4k6B0ArXE87+3y1Jc9XggQEDYEAGYg+0rbCFN3/dRaMlWBDEOGAOzMvGy X-Received: by 2002:a17:90b:3a8d:b0:277:66be:f3ad with SMTP id om13-20020a17090b3a8d00b0027766bef3admr1707636pjb.11.1696291990718; Mon, 02 Oct 2023 17:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696291990; cv=none; d=google.com; s=arc-20160816; b=fBhqX1XmTHF8bDHLnNQU2h+uNc6y8Y1g1wzBfsuMkRxnewVGHo8dPZXft3U+cnQLNZ Tyjgbds5maLwXbQ32q2Q7uiDy1/GK0xv5ZJeRlhsv3H7DXlPPf004ee8VP/aSXYay8Gu Ri49Yer98/4aaQPO9Gpicp4gWfxsKPL43GvWlD3TyWr+3PUg5sh/T9kF4pKHDo8HYrJ3 gRr8Fd1TA9vWuM5aJpA0Sie00l/2OgZK8zWQNZ/sezS3Rh5mzOWy7CJIIu/eCwYpH1Nc MkWBxMd2LS7DSCDfqi54E4HD/l/3HR4OtlOS3ZMiprQD3b2MqMCTMVfk9Hz7Y7VYYFEr GCmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zpzQO8HbLLTPu6D1/OgydzIxmygx7jcnUo/6D03H5hI=; fh=hT7Tz+Jlg18zhZY+iUP/igRheEJJrO2wqBIgEii9Erc=; b=eO5Qqgb7GPDMJdg7HMkrnxsqzshp2Mrykfx4iugz2Ke0MqGAiSCONYMAv+9vekj/VL d8zCPqKLTvGRz9gkyRWbIdmRXIHsvNylnaW3IrMFxilSdAWikRRk72Tm4bt5SxEYtcxF gHpGKRsY96JyTQEjXStq9rJcVqMAyOGYak9KakdcscMUSoLK3beP2OXUjoGd1dJp7VSM edH37GYZcjkxlaTm2mFzJogUGkgPLi5vt0Ac7F1CYZYSpNmcbeqG5o6ioSLNuSbhHVXm MmSD9hV96MoT59BkaP0Yas4e0y9R9gP53LTNtuc+LvN4xUqGAkJAA6lxsC6MvuK5OD6W wAUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=X7bdRYY0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id f6-20020a63e306000000b00577448019b5si125318pgh.276.2023.10.02.17.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 17:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=X7bdRYY0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 02B118245A4F; Mon, 2 Oct 2023 17:13:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237541AbjJCANI (ORCPT + 99 others); Mon, 2 Oct 2023 20:13:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjJCANI (ORCPT ); Mon, 2 Oct 2023 20:13:08 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 142A7E6 for ; Mon, 2 Oct 2023 17:13:04 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-65af726775eso2766686d6.0 for ; Mon, 02 Oct 2023 17:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696291983; x=1696896783; 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=zpzQO8HbLLTPu6D1/OgydzIxmygx7jcnUo/6D03H5hI=; b=X7bdRYY0/rynfyoAhSoUh9L8FwvVIleMHYV3oQeM67EEXIdVOiZSw5tSmyocEinHJ/ xUsV6xnHtdy17N3j8z+ur22UZ0O7f66mdU/bTk+8dFqX/Mj+aU601qu/01XqU9PTh7Ce ScpKU6p0MtpyF9T2OCVkmv861WPlKJ/qN16xiJ1kM67yrY7aLTz7oY2tFCWvfbAOoOIP 1+D60iYy06D0eeY9c4Icf22ebFxkQoQoW9d9ULLRqB/FF998eWlTsouqWysAGKd5o8dc o45LbNm/2gVyWoSip9j/wpUgkSSP9ep5d+6uXaWDsLQIiEKb2oq0ziXUIkqxS4f0Um4o yU0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696291983; x=1696896783; 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=zpzQO8HbLLTPu6D1/OgydzIxmygx7jcnUo/6D03H5hI=; b=rL+QbQENoNox/GeUu4M9taoTnDo3Ea1g2cTCxDTva7yb7MOSRQtZuBX00SxamsXTdl 1eIo4CfWG/LBkUTwyNZbv4VRFq5LiFIhtOhpyQeApSZ6fNIIuhHPKFZxX05hEHMclWup ftCs6jDsAgTDaO1o1pktzbQm5divE4T+XrwzefgGUhXtsur+JIjQNyRTi5NZMhfXdwfu Ea70JM/JB6yVwjxGTLYtV2Lem+pNjGucWlXswk5NRIUvawqpL5rpv/ff+8GNtHKzkMlI FejcdECHW9s9DMvfUJMHa6lA8W6P14IXMPTMti0TNt3/n1dr4d8m3HojT+0pL5unaOm7 L3VQ== X-Gm-Message-State: AOJu0Yzdn4quyl24U+Dqy+3uscukWk2gcYoypZQWrZRPNDU2AK/iaoqC CI6iXGPBOE0PSZpoW3TPj6bAZ6IdTi7OD7JB5qLIeA== X-Received: by 2002:a0c:aad5:0:b0:65b:92c:3eee with SMTP id g21-20020a0caad5000000b0065b092c3eeemr1505639qvb.15.1696291982695; Mon, 02 Oct 2023 17:13:02 -0700 (PDT) MIME-Version: 1.0 References: <20230929023737.1610865-1-maheshb@google.com> In-Reply-To: From: =?UTF-8?B?TWFoZXNoIEJhbmRld2FyICjgpK7gpLngpYfgpLYg4KSs4KSC4KSh4KWH4KS14KS+4KSwKQ==?= Date: Mon, 2 Oct 2023 17:12:36 -0700 Message-ID: Subject: Re: [PATCH 1/4] time: add ktime_get_cycles64() api To: John Stultz Cc: Netdev , Linux , David Miller , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Jonathan Corbet , Don Hatchett , Yuliang Li , Mahesh Bandewar , Thomas Gleixner , Stephen Boyd , Richard Cochran Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 17:13:09 -0700 (PDT) On Fri, Sep 29, 2023 at 12:07=E2=80=AFAM John Stultz w= rote: > > On Thu, Sep 28, 2023 at 11:56=E2=80=AFPM John Stultz = wrote: > > On Thu, Sep 28, 2023 at 11:35=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 Thu, Sep 28, 2023 at 10:15=E2=80=AFPM John Stultz wrote: > > > > 3) Nit: The interface is called ktime_get_cycles64 (timespec64 > > > > returning interfaces usually are postfixed with ts64). > > > > > > > Ah, thanks for the explanation. I can change to comply with the > > > convention. Does ktime_get_cycles_ts64() make more sense? > > > > Maybe a little (it at least looks consistent), but not really if > > you're sticking raw cycles in the timespec :) > > > > Despite my concerns that it's a bad idea, If one was going to expose > raw cycles from the timekeeping core, I'd suggest doing so directly as > a u64 (`u64 ktime_get_cycles(void)`). > > That may mean widening (or maybe using a union in) your PTP ioctl data > structure to have a explicit cycles field. > Or introducing a separate ioctl that deals with cycles instead of timespe= c64s. > > Squeezing data into types that are canonically used for something else > should always be avoided if possible (there are some cases where > you're stuck with an existing interface, but that's not the case > here). > > But I still think we should avoid exporting the raw cycle values > unless there is some extremely strong argument for it (and if we can, > they should be abstracted into some sort of cookie value to avoid > userland using it as a raw clock). > Thanks for the input John. This change is basically to address the API gap and allow it to give a user-given timebase for the sandwich time. I will remove this RAW-CYCLES option for now. If it's deemed necessary, we can always add it later into the same API. > thanks > -john