Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1694397rdb; Mon, 2 Oct 2023 19:33:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoH5NzCkH1vhJ9LINO6XOCX6XF4i5sLvf67+5VbfWnj1xwv9MbHQMR+8shCOr2+6L9bpmp X-Received: by 2002:a05:620a:1987:b0:774:ebd:9f8c with SMTP id bm7-20020a05620a198700b007740ebd9f8cmr14474164qkb.60.1696300391429; Mon, 02 Oct 2023 19:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696300391; cv=none; d=google.com; s=arc-20160816; b=J+RuHUHKVFJR125lnGGQ+4fKYT1/H/JNzfvorEF8IcjOpa4TMfuFquV5uSw/W0VAR0 qt21ChKCVJfyhGPlxP8tpLyuJNIxCDwIKxcquq2vsDAo17an2FTD5M/Vi3d1Vb8hjry4 ce6nyjjrWPrUQeAENoiTibjzLMhwO2RuAvfodYc+jFPa85no3Jy9xNAX7dSHRRWQ/Vxa 2MS01gEjw2efErPYk7lMAbQIhPmitAfoYq8jVFA4OWO2F4ZIP+Ga/RQXoZJnne4w+zag tnYELja958+VbYXuhPH0lTx6X1RDexPzADLu5GKbv5wGjcAsedjLSHkY1KWdCqV4OUzO uuvQ== 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=al5wsxcEEaN9EiW9Q10StMwifcs508QOq5CB2e+zVuE=; fh=GYVwUuEyzEaEZK3zIRhRsbD53X9sppHYvicbzmiS8PQ=; b=1KWAoFxs2LE9jbJhbqF0mF0nPCfWRY9sSr8jvzFZjWSsKcEZC1f8BGAw01OgiZXtVE qzlxlCh9OrqPV3N4pFnGyEXZubFVdWYaop/6nC8ybzIWAnTq3YLNu3ug5zv53Rf/IWNA LEOFA3TVk2U6A84BVZDNZdGabLKv3LXmxYjY62HvXsoTDRjfh3DWeWDvEjBYAkuPBjPv i+BWy3zydivA5M8w9cYDTF4uh6ox8N6ophd2uOz0inf4ycsjlsFDGzdAt3EshfoqtaOZ qONkhu9iZAqEX/fJsyoaQkd0xFXnW97+dbb88JtL7W0lJBJF6FClmEfnxpSVE/Y+3n3z cKeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=JEder+Cw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id m187-20020a6326c4000000b005645d9a89d6si366128pgm.554.2023.10.02.19.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 19:33:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=JEder+Cw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 34C20801BE9D; Mon, 2 Oct 2023 19:33:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239001AbjJCCc1 (ORCPT + 99 others); Mon, 2 Oct 2023 22:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbjJCCc0 (ORCPT ); Mon, 2 Oct 2023 22:32:26 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 845FFBD for ; Mon, 2 Oct 2023 19:32:23 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-405459d9a96so47835e9.0 for ; Mon, 02 Oct 2023 19:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696300342; x=1696905142; 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=al5wsxcEEaN9EiW9Q10StMwifcs508QOq5CB2e+zVuE=; b=JEder+CwoTzfgoSh5q3l6XLAlAXUPid8zXnLr896D5cV4xUPqnlkb+6KUVZbPdtGFR CwKs8MPlCfslQVtbqWEiSVgTx+qMFIlFxlLHf/3AixlJ+Tdke1/AftgVhbc1xs1zc5Mi AikMxYQUmjvjpTQWyEkxM4UNl1C7HfCsBmtKoTPJJbI3p7EwUJO4La10oonv9uQvvShV yk3f9b8NP2wACjQ4YS4700hwkZ3TskMtZ8LwzAUuoHBNEZzt/pJAELnUj0/14UxNtkHJ 8VPviB1m4H3Et4eu9ch9qB+ugAgLhm17IiGCuT3zMvgs+A7SYO32N3evGfZFLMbMRZCJ /H+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696300342; x=1696905142; 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=al5wsxcEEaN9EiW9Q10StMwifcs508QOq5CB2e+zVuE=; b=c8n4Nmap4Laf6W0TybLAlFdyjHhDPnWM2iqa2anzpkWXt47G540M95Cv4JS0mn1LGq J3gh7TvHY3MdJnf6Z/js9cIdialynNfvi3mGDFOwsZMJYZD1hfBXIKm7I+8uhgoP1pfy VX0z2LH9G8aHb01J15GQirtuS5h1Jigq7gN6+5eSe8TJtd4p3BbzaVk50DAB3TgZ6hCV e0fAKE8evZqczTA1vZgHYCY3SUF6QxsB38+BQheFLcx9mC5WzHz7MiS8rqbtcJ2KbisS FECE62rrv0dLA/3KNgNjnCZs2I9gp2U7x4HsUJznnta7a+OADPzx9FRMnOJ9bOwoW8Wg qZZQ== X-Gm-Message-State: AOJu0YzPjQVcb0Es0iP05z3/HfMqJuBfNx7E26E/lcWigioNE6fs9qwI htrwkrhVusq8DGaHInwwFDc8kyoaILeqmt6jJrHT X-Received: by 2002:a05:600c:3b82:b0:400:c6de:6a20 with SMTP id n2-20020a05600c3b8200b00400c6de6a20mr38797wms.3.1696300341777; Mon, 02 Oct 2023 19:32:21 -0700 (PDT) MIME-Version: 1.0 References: <20230929023737.1610865-1-maheshb@google.com> In-Reply-To: From: John Stultz Date: Mon, 2 Oct 2023 19:32:10 -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=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Mon, 02 Oct 2023 19:33:09 -0700 (PDT) On Mon, Oct 2, 2023 at 5:13=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 Fri, Sep 29, 2023 at 12:07=E2=80=AFAM John Stultz = wrote: > > > > 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 times= pec64s. > > > > 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. Sounds reasonable to me. thanks -john