diff options
author | Hou Tao <[email protected]> | 2022-08-10 16:05:35 +0800 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2022-08-10 10:12:48 -0700 |
commit | d247049f4fd088e4e40294819a932a6057b3632c (patch) | |
tree | 206244e8fd1c6487d541dea2c9405580de17c60e /scripts/gdb/linux/utils.py | |
parent | 52bd05eb7c88e1ad8541a48873188ccebca9da26 (diff) |
bpf: Only allow sleepable program for resched-able iterator
When a sleepable program is attached to a hash map iterator, might_fault()
will report "BUG: sleeping function called from invalid context..." if
CONFIG_DEBUG_ATOMIC_SLEEP is enabled. The reason is that rcu_read_lock()
is held in bpf_hash_map_seq_next() and won't be released until all elements
are traversed or bpf_hash_map_seq_stop() is called.
Fixing it by reusing BPF_ITER_RESCHED to indicate that only non-sleepable
program is allowed for iterator without BPF_ITER_RESCHED. We can revise
bpf_iter_link_attach() later if there are other conditions which may
cause rcu_read_lock() or spin_lock() issues.
Signed-off-by: Hou Tao <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions