[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210709035250.tk35xdptiawpnu4x@ast-mbp.dhcp.thefacebook.com>
Date: Thu, 8 Jul 2021 20:52:50 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Martin KaFai Lau <kafai@...com>
Cc: davem@...emloft.net, daniel@...earbox.net, andrii@...nel.org,
netdev@...r.kernel.org, bpf@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH v5 bpf-next 00/11] bpf: Introduce BPF timers.
On Thu, Jul 08, 2021 at 06:59:49PM -0700, Martin KaFai Lau wrote:
> On Wed, Jul 07, 2021 at 06:18:22PM -0700, Alexei Starovoitov wrote:
> > From: Alexei Starovoitov <ast@...nel.org>
> >
> > The first request to support timers in bpf was made in 2013 before sys_bpf syscall
> > was added. That use case was periodic sampling. It was address with attaching
> > bpf programs to perf_events. Then during XDP development the timers were requested
> > to do garbage collection and health checks. They were worked around by implementing
> > timers in user space and triggering progs with BPF_PROG_RUN command.
> > The user space timers and perf_event+bpf timers are not armed by the bpf program.
> > They're done asynchronously vs program execution. The XDP program cannot send a
> > packet and arm the timer at the same time. The tracing prog cannot record an
> > event and arm the timer right away. This large class of use cases remained
> > unaddressed. The jiffy based and hrtimer based timers are essential part of the
> > kernel development and with this patch set the hrtimer based timers will be
> > available to bpf programs.
> >
> > TLDR: bpf timers is a wrapper of hrtimers with all the extra safety added
> > to make sure bpf progs cannot crash the kernel.
> Looked more closely from 1-6. Left minor comments in patch 4.
> The later verifier changes make sense to me but I won't be very useful there.
Thanks a lot for detailed code review. Much appreciate it!
Powered by blists - more mailing lists