Thread (42 messages) 42 messages, 5 authors, 2021-08-11

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

From: Song Liu <hidden>
Date: 2021-04-06 01:08:20
Also in: bpf

On Apr 5, 2021, at 4:49 PM, Cong Wang [off-list ref] wrote:

On Fri, Apr 2, 2021 at 4:31 PM Song Liu [off-list ref] wrote:
quoted

quoted
On Apr 2, 2021, at 1:57 PM, Cong Wang [off-list ref] wrote:

Ideally I even prefer to create timers in kernel-space too, but as I already
explained, this seems impossible to me.
Would hrtimer (include/linux/hrtimer.h) work?
By impossible, I meant it is impossible (to me) to take a refcnt to the callback
prog if we create the timer in kernel-space. So, hrtimer is the same in this
perspective.

Thanks.
I guess I am not following 100%. Here is what I would propose:

We only introduce a new program type BPF_PROG_TYPE_TIMER. No new map type. 
The new program will trigger based on a timer, and the program can somehow 
control the period of the timer (for example, via return value).

With this approach, the user simply can create multiple timer programs and 
hold the fd for them. And these programs trigger up to timer expiration. 

Does this make sense?

Thanks,
Song
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help