Netdev List
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: "Andrii Nakryiko" <andrii.nakryiko@gmail.com>,
	"Maciej Żenczykowski" <maze@google.com>
Cc: bimmy.pujari@intel.com, bpf <bpf@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	mchehab@kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, Martin Lau <kafai@fb.com>,
	ashkan.nikravesh@intel.com
Subject: Re: [PATCH] bpf: Add bpf_ktime_get_real_ns
Date: Tue, 28 Jul 2020 14:57:07 -0600	[thread overview]
Message-ID: <9e9ca486-f6f5-2301-8850-8f53429b160e@gmail.com> (raw)
In-Reply-To: <CAEf4BzaiCZ3rOBc0EXuLUuWh9m5QXv=51Aoyi5OHwb6T11nnjw@mail.gmail.com>

On 7/28/20 12:28 PM, Andrii Nakryiko wrote:
> In some, yes, which also means that in some other they can't. So I'm
> still worried about misuses of REALCLOCK, within (internal daemons
> within the company) our outside (BCC tools and alike) of data centers.
> Especially if people will start using it to measure elapsed time
> between events. I'd rather not have to explain over and over again
> that REALCLOCK is not for measuring passage of time.

Why is documenting the type of clock and its limitations not sufficient?
Users are going to make mistakes and use of gettimeofday to measure time
differences is a common one for userspace code. That should not define
or limit the ability to correctly and most directly do something in bpf.

I have a patch to export local_clock as bpf_ktime_get_fast_ns. It too
can be abused given that it has limitations (can not be used across CPUs
and does not correlate to any exported clock), but it too has important
use cases (twice as fast as bpf_ktime_get_ns and useful for per-cpu
delta-time needs).

Users have to know what they are doing; making mistakes is part of
learning. Proper documentation is all you can do.

  reply	other threads:[~2020-07-28 20:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 23:34 [PATCH] bpf: Add bpf_ktime_get_real_ns bimmy.pujari
2020-07-27 23:52 ` Song Liu
2020-07-28  5:01 ` Andrii Nakryiko
     [not found]   ` <CANP3RGd2fKh7qXyWVeqPM8nVKZRtJrJ65apmGF=w9cwXy6TReQ@mail.gmail.com>
2020-07-28 18:28     ` Andrii Nakryiko
2020-07-28 20:57       ` David Ahern [this message]
2020-07-29  5:15         ` Andrii Nakryiko
2020-07-29 14:08           ` David Ahern
     [not found]       ` <BYAPR11MB3752ECD1819CE1B987D0B07288730@BYAPR11MB3752.namprd11.prod.outlook.com>
2020-07-29  5:09         ` Andrii Nakryiko
2020-08-18 20:50   ` Daniel Xu
2020-08-18 21:19     ` Maciej Żenczykowski
2020-08-18 23:03       ` Daniel Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e9ca486-f6f5-2301-8850-8f53429b160e@gmail.com \
    --to=dsahern@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ashkan.nikravesh@intel.com \
    --cc=ast@kernel.org \
    --cc=bimmy.pujari@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=maze@google.com \
    --cc=mchehab@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox