[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201117205611.mwvz7tt2lsczzdh5@kafai-mbp.dhcp.thefacebook.com>
Date: Tue, 17 Nov 2020 12:56:11 -0800
From: Martin KaFai Lau <kafai@...com>
To: Dmitrii Banshchikov <me@...que.spb.ru>
CC: <bpf@...r.kernel.org>, <kernel-team@...com>, <rdna@...com>,
<ast@...nel.org>, <daniel@...earbox.net>, <songliubraving@...com>,
<yhs@...com>, <andrii@...nel.org>, <john.fastabend@...il.com>,
<kpsingh@...omium.org>, <toke@...hat.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next] bpf: Add bpf_ktime_get_coarse_ns helper
On Tue, Nov 17, 2020 at 06:45:49PM +0000, Dmitrii Banshchikov wrote:
> The helper uses CLOCK_MONOTONIC_COARSE source of time that is less
> accurate but more performant.
>
> We have a BPF CGROUP_SKB firewall that supports event logging through
> bpf_perf_event_output(). Each event has a timestamp and currently we use
> bpf_ktime_get_ns() for it. Use of bpf_ktime_get_coarse_ns() saves ~15-20
> ns in time required for event logging.
>
> bpf_ktime_get_ns():
> EgressLogByRemoteEndpoint 113.82ns 8.79M
> bpf_ktime_get_coarse_ns():
> EgressLogByRemoteEndpoint 95.40ns 10.48M
Acked-by: Martin KaFai Lau <kafai@...com>
Powered by blists - more mailing lists