bpf: Implement stack_map_get_build_id_offset_sleepable()
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest3 patches 3 repliesApplied 3/3
- v63 patches 9 repliesSuperseded
- v53 patches 6 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 3 patches | 8 replies | Superseded | |
| v3 | 3 patches | 4 replies | Superseded | |
| v2 | 2 patches | 5 replies | Superseded |
Changes in v7 from the cover letter
* Addressed feedback from Andrii (mostly patch #2):
* implement proper CONFIG_PER_VMA_LOCK=n support, following a VMA locking pattern similar to one used in PROCMAP_QUERY
* change the contract of stack_map_lock_vma(): if a non-NULL VMA is returned, then a read lock is held
* remove now unnecessary vma_locked flag
* and various other nits
* Add vma_is_anonymous() checks where appropriate (AIs)
v6: https://lore.kernel.org/bpf/[email protected]/
Patches in v7 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | bpf: Factor out stack_map build ID helperskernel/ | +40 | 2 replies | Applied |
| 2/3 | bpf: Avoid faultable build ID reads under mm lockskernel/ | +109 | 0 replies | Applied |
| 3/3 | bpf: Cache build IDs in sleepable stackmap pathkernel/ | +55 | 1 reply | Applied |
Reviews trailers per patch
2 of 3 patches have a Reviewed-by or Acked-by.
| Patch | Mykyta Yatsenko | Andrii Nakryiko |
|---|---|---|
| 1/3 | A-b | |
| 2/3 | ||
| 3/3 | A-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v7 0/3] bpf: Implement stack_map_get_build_id_offset_sleepable()
The series introduces stack_map_get_build_id_offset_sleepable(), fixing a gap with parsing build_id in sleepable context in stackmap.c
In particular, this fixes a deadlock in stack_map_get_build_id_offset() doing a blocking __kernel_read(), which happens since commit 777a8560fd29 ("lib/buildid: use __kernel_read() for sleepable context").
See previous revisions for more details.
---
v6->v7:
* Addressed feedback from Andrii (mostly patch #2):
* implement proper CONFIG_PER_VMA_LOCK=n support, following a VMA locking pattern similar to one used in PROCMAP_QUERY
* change the contract of stack_map_lock_vma(): if a non-NULL VMA is returned, then a read lock is held
* remove now unnecessary vma_locked flag
* and various other nits
* Add vma_is_anonymous() checks where appropriate (AIs)
v6: https://lore.kernel.org/bpf/[email protected]/
v5->v6:
* Misc refactoring (Andrii):
* add stack_map_build_id_set_valid() helper
* simplify control flow in stack_map_get_build_id_offset_sleepable()
v5: https://lore.kernel.org/bpf/[email protected]/
v4->v5:
* Add comments explaining mmap_read_trylock() (Shakeel)
* Rebase on bpf-next (Alexei)
v4: https://lore.kernel.org/bpf/[email protected]/
v3->v4:
* Change Fixes tag in patch #2 (AI)
* Nit in caching implementation (Mykyta)
v3: https://lore.kernel.org/bpf/[email protected]/
v2->v3:
* Split patch #2 in two: stack_map_get_build_id_offset_sleepable() implementation, and then introduce caching
* Drop taking mmap_lock if CONFIG_PER_VMA_LOCK=n, fall back to raw IPs instead
* Cache vm_{start,end} in addition to prev_file (Mykyta)
v2: https://lore.kernel.org/bpf/[email protected]/
v1->v2:
* Addressed feedback from Puranjay:
* split out a small refactoring patch
* use mmap_read_trylock()
* take into account CONFIG_PER_VMA_LOCK
* replace find_vma() with vma_lookup()
* cache prev_build_id to avoid re-parsing the same file
* Snapshot vm_pgoff and vm_start before unlocking (AI)
* To avoid repetitive unlocking statements, introduce struct stack_map_vma_lock to hold relevant lock state info and add an unlock helper
v1: https://lore.kernel.org/bpf/[email protected]/
---
Ihor Solodrai (3):
bpf: Factor out stack_map build ID helpers
bpf: Avoid faultable build ID reads under mm locks
bpf: Cache build IDs in sleepable stackmap path
kernel/bpf/stackmap.c | 215 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 198 insertions(+), 17 deletions(-)
Signature · 1 line
2.54.0