Commit d6247ec
bpf: Add ability to pin bpf timer to calling CPU
BPF supports creating high resolution timers using bpf_timer_* helper
functions. Currently, only the BPF_F_TIMER_ABS flag is supported, which
specifies that the timeout should be interpreted as absolute time. It
would also be useful to be able to pin that timer to a core. For
example, if you wanted to make a subset of cores run without timer
interrupts, and only have the timer be invoked on a single core.
This patch adds support for this with a new BPF_F_TIMER_CPU_PIN flag.
When specified, the HRTIMER_MODE_PINNED flag is passed to
hrtimer_start(). A subsequent patch will update selftests to validate.
Signed-off-by: David Vernet <void@manifault.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/bpf/20231004162339.200702-2-void@manifault.com1 parent 84cb9cb commit d6247ec
3 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5096 | 5096 | | |
5097 | 5097 | | |
5098 | 5098 | | |
| 5099 | + | |
| 5100 | + | |
5099 | 5101 | | |
5100 | 5102 | | |
5101 | 5103 | | |
| |||
7309 | 7311 | | |
7310 | 7312 | | |
7311 | 7313 | | |
| 7314 | + | |
7312 | 7315 | | |
7313 | 7316 | | |
7314 | 7317 | | |
| 7318 | + | |
7315 | 7319 | | |
7316 | 7320 | | |
7317 | 7321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1272 | 1272 | | |
1273 | 1273 | | |
1274 | 1274 | | |
1275 | | - | |
| 1275 | + | |
1276 | 1276 | | |
1277 | 1277 | | |
1278 | 1278 | | |
| |||
1286 | 1286 | | |
1287 | 1287 | | |
1288 | 1288 | | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
1289 | 1292 | | |
1290 | 1293 | | |
1291 | 1294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5096 | 5096 | | |
5097 | 5097 | | |
5098 | 5098 | | |
| 5099 | + | |
| 5100 | + | |
5099 | 5101 | | |
5100 | 5102 | | |
5101 | 5103 | | |
| |||
7309 | 7311 | | |
7310 | 7312 | | |
7311 | 7313 | | |
| 7314 | + | |
7312 | 7315 | | |
7313 | 7316 | | |
7314 | 7317 | | |
| 7318 | + | |
7315 | 7319 | | |
7316 | 7320 | | |
7317 | 7321 | | |
| |||
0 commit comments