Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp103265rdb; Fri, 29 Sep 2023 19:06:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXjoa3yJwB+x+Gt2xtrU6gCE+/o632Uk9dVgU9DpciFfZwckbUzGJULpwsWGnHNBF8mAiF X-Received: by 2002:a54:4809:0:b0:3ae:108c:57b3 with SMTP id j9-20020a544809000000b003ae108c57b3mr5973483oij.39.1696039613349; Fri, 29 Sep 2023 19:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696039613; cv=none; d=google.com; s=arc-20160816; b=EvunOj3LtTVaBuZvHuH4Vyj2D6679v16lx1PbGmQBQmdYHO3gTzULQPestc+hLbJ2S rNvGuC+AYeL6usuClqc30lyDCrmzL3f69o+3FNerhC442U5P3CtxqMrKoGJiBGL2hH+M jHeF9R2f89/hoB84bf82kUZ21tUyLn6x+xf7mDJr9b4NpmzBJfW/aLiW0H3MeJO3qC6V R6bYIpUUybzpWBZu/riHvNxE1LT/zz94TVTeM5dBWGNQSMWrAAJmxGuPgh5CQIn0m4kR g0SLJNrnV6UvKON7qLpGeQYB+oPr2tvGqyW3cGIU+TRzxhSQHKyGCXlcxeOKatcdVn5O T+DA== 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=8VDhsG3RvqxurmnHIUU3NyMw2Ckx5kzAqe1lOg3jvtw=; fh=GYVwUuEyzEaEZK3zIRhRsbD53X9sppHYvicbzmiS8PQ=; b=eAJnr71y2y/g6CYURo7CEwimwWRfh9o7CMvOk+J5VeEuUkihfTQktqSaGwm6c3pHpP jzwiGUH/Np44hUeuZlstD0pSIZliv9f8XZfskIs0e1BQsrwFa6PnefFB+xWxBlItbMfC +UAfZPdfwFkwKu7Gdv/ZM2yG/Nzmi2+6SAAFxuP1tsYtO1mc2V5Ets4urTVM6aT971BY 3kRokw0mNZzRATnxLD9vdCDETEbxXNIByM8to0GBvTK5ygMV4TPSP/Uznafh095ko2+u Lw0+8hH450v/fFsPSE/MWQc4Arvz5uAh8i6C7/ZgPcfMN7hVyUQ8aR1fcBFggcHJ2GGt YbfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="yqOdf/Xe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y17-20020a63de51000000b0056949ba3f3fsi10378987pgi.253.2023.09.29.19.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 19:06:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="yqOdf/Xe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 3754D8212A87; Fri, 29 Sep 2023 00:07:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232731AbjI2HHF (ORCPT + 99 others); Fri, 29 Sep 2023 03:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbjI2HHC (ORCPT ); Fri, 29 Sep 2023 03:07:02 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C48911AB for ; Fri, 29 Sep 2023 00:07:00 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-534694a9f26so7303a12.1 for ; Fri, 29 Sep 2023 00:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695971219; x=1696576019; 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=8VDhsG3RvqxurmnHIUU3NyMw2Ckx5kzAqe1lOg3jvtw=; b=yqOdf/Xe738+uS/bdp7sa/4PaONqHb7OVBN4HkvAdt2ijif6Y4+bm7V9iAD0igjNZs cONxpOdz/qUyZ9mlxY5Ckj6fFtCsMEWx98jqa6FmwoOy/RwkPI+leXv9N3RiQ1H21cQU l6Z9APHuPqwGsn4re+yEqh9525Iiz9yA49UrF1bebORvtZa4K/jPm7IzPFFniMpYT2Q5 YMdEUHpkSs33IR3lo97OyCLZheebi7H3a+BQV6zAqViYxonj5rJuo2KjeYunod79Cov9 zd6+I2CX8rK1nLLWvYMqmB+nmEW6yYxWIPT7qFfsTId4bjF3G+JvNtjY9HcCXWNW3epU pGnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695971219; x=1696576019; 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=8VDhsG3RvqxurmnHIUU3NyMw2Ckx5kzAqe1lOg3jvtw=; b=Nbu2cZY4QZn+7GVlHSlFuX+osyWzC13kzLTh7dxZRVWmVafWJ4t+Nz1G0OQxAXYwM/ eJWKluyowP4blY0QxUhj0tBpfxoFe9LoSadws6vX5qDYVSyok3C2Z8p/z0NmsIyBDJJY 6mZqxyZduT/5BcaRPbbxYYf/9JDyjvWKIfpqDmEeKqdQiqPZ6pld9jZrEfRK0zy1u1Ms SoQhWdG20L3ytehVfTnTHOR15LsMqPDr31/iIlS5RdJi5ykRXiBbXtUkZVEEkcP6cyB7 WtoD0U2U4ToEHQMaIWNtAgzNCzONfcNYm9igLbHQo4cY0sJilqITvuGJYPD1/VZ24yfM Vauw== X-Gm-Message-State: AOJu0Yxkew9JVeNUHolLDZkMq8ppJzDu0n0HfCcF88SYMayUigUX5Nr4 aTbk6FOlpjUtbNksY4Uldn7l3krCXnJFBAK4I/DmpghKBKUq4mvfag== X-Received: by 2002:a50:aa93:0:b0:52e:f99a:b5f8 with SMTP id q19-20020a50aa93000000b0052ef99ab5f8mr493256edc.7.1695971219021; Fri, 29 Sep 2023 00:06:59 -0700 (PDT) MIME-Version: 1.0 References: <20230929023737.1610865-1-maheshb@google.com> In-Reply-To: From: John Stultz Date: Fri, 29 Sep 2023 00:06:46 -0700 Message-ID: Subject: Re: [PATCH 1/4] time: add ktime_get_cycles64() api To: =?UTF-8?B?TWFoZXNoIEJhbmRld2FyICjgpK7gpLngpYfgpLYg4KSs4KSC4KSh4KWH4KS14KS+4KSwKQ==?= 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 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 00:07:09 -0700 (PDT) On Thu, Sep 28, 2023 at 11:56=E2=80=AFPM John Stultz w= rote: > 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 timespec6= 4s. 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 -john