Commit 1bea596
bpf: Refactor storage_get_func_atomic to generic non_sleepable flag
Rename the storage_get_func_atomic flag to a more generic non_sleepable
flag that tracks whether a helper or kfunc may be called from a
non-sleepable context. This makes the flag more broadly applicable
beyond just storage_get helpers. See [0] for more context.
The flag is now set unconditionally for all helpers and kfuncs when:
- RCU critical section is active.
- Preemption is disabled.
- IRQs are disabled.
- In a non-sleepable context within a sleepable program (e.g., timer
callbacks), which is indicated by !in_sleepable().
Previously, the flag was only set for storage_get helpers in these
contexts. With this change, it can be used by any code that needs to
differentiate between sleepable and non-sleepable contexts at the
per-instruction level.
The existing usage in do_misc_fixups() for storage_get helpers is
preserved by checking is_storage_get_function() before using the flag.
[0]: https://lore.kernel.org/bpf/CAP01T76cbaNi4p-y8E0sjE2NXSra2S=Uja8G4hSQDu_SbXxREQ@mail.gmail.com
Cc: Mykyta Yatsenko <[email protected]>
Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
Acked-by: Eduard Zingerman <[email protected]>
Acked-by: Mykyta Yatsenko <[email protected]>1 parent eaa7363 commit 1bea596
2 files changed
+18
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
| 551 | + | |
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11371 | 11371 | | |
11372 | 11372 | | |
11373 | 11373 | | |
| 11374 | + | |
| 11375 | + | |
| 11376 | + | |
| 11377 | + | |
| 11378 | + | |
| 11379 | + | |
| 11380 | + | |
| 11381 | + | |
| 11382 | + | |
11374 | 11383 | | |
11375 | 11384 | | |
11376 | 11385 | | |
| |||
11437 | 11446 | | |
11438 | 11447 | | |
11439 | 11448 | | |
11440 | | - | |
11441 | | - | |
11442 | | - | |
11443 | 11449 | | |
11444 | 11450 | | |
11445 | 11451 | | |
| |||
11448 | 11454 | | |
11449 | 11455 | | |
11450 | 11456 | | |
11451 | | - | |
11452 | | - | |
11453 | | - | |
11454 | 11457 | | |
11455 | 11458 | | |
11456 | 11459 | | |
| |||
11459 | 11462 | | |
11460 | 11463 | | |
11461 | 11464 | | |
11462 | | - | |
11463 | | - | |
11464 | | - | |
11465 | 11465 | | |
11466 | 11466 | | |
11467 | | - | |
11468 | | - | |
11469 | | - | |
11470 | | - | |
11471 | | - | |
11472 | | - | |
| 11467 | + | |
| 11468 | + | |
| 11469 | + | |
11473 | 11470 | | |
11474 | 11471 | | |
11475 | 11472 | | |
| |||
13880 | 13877 | | |
13881 | 13878 | | |
13882 | 13879 | | |
| 13880 | + | |
| 13881 | + | |
| 13882 | + | |
| 13883 | + | |
13883 | 13884 | | |
13884 | 13885 | | |
13885 | 13886 | | |
| |||
22502 | 22503 | | |
22503 | 22504 | | |
22504 | 22505 | | |
22505 | | - | |
| 22506 | + | |
22506 | 22507 | | |
22507 | 22508 | | |
22508 | 22509 | | |
| |||
0 commit comments