Re: [PATCH bpf-next] bpf: Add bpf_ktime_get_coarse_ns helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux