Commit 2c52e89
bpf: dispatch to sleepable file dynptr
File dynptr reads may sleep when the requested folios are not in
the page cache. To avoid sleeping in non-sleepable contexts while still
supporting valid sleepable use, given that dynptrs are non-sleepable by
default, enable sleeping only when bpf_dynptr_from_file() is invoked
from a sleepable context.
This change:
* Introduces a sleepable constructor: bpf_dynptr_from_file_sleepable()
* Override non-sleepable constructor with sleepable if it's always
called in sleepable context
Signed-off-by: Mykyta Yatsenko <[email protected]>
Acked-by: Eduard Zingerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>1 parent d869d56 commit 2c52e89
3 files changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
673 | 676 | | |
674 | 677 | | |
675 | 678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4336 | 4336 | | |
4337 | 4337 | | |
4338 | 4338 | | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
4339 | 4344 | | |
4340 | 4345 | | |
4341 | 4346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3124 | 3124 | | |
3125 | 3125 | | |
3126 | 3126 | | |
3127 | | - | |
| 3127 | + | |
| 3128 | + | |
3128 | 3129 | | |
3129 | 3130 | | |
3130 | 3131 | | |
| |||
21869 | 21870 | | |
21870 | 21871 | | |
21871 | 21872 | | |
21872 | | - | |
| 21873 | + | |
21873 | 21874 | | |
21874 | 21875 | | |
21875 | 21876 | | |
| |||
21904 | 21905 | | |
21905 | 21906 | | |
21906 | 21907 | | |
| 21908 | + | |
| 21909 | + | |
| 21910 | + | |
21907 | 21911 | | |
21908 | 21912 | | |
21909 | 21913 | | |
| |||
21963 | 21967 | | |
21964 | 21968 | | |
21965 | 21969 | | |
21966 | | - | |
| 21970 | + | |
21967 | 21971 | | |
21968 | 21972 | | |
21969 | 21973 | | |
| |||
0 commit comments