fix lockdep warnings with kmalloc_nolock()
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 1 replyIn review
- v12 patches 9 repliesSuperseded
Changes in v2 from the cover letter
- Patch 1: per Vlastimil's suggestion, do not access current->mems_allowed_seq and avoid retry if !allow_spin, rather than returning NULL.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm/slab: do not access current->mems_allowed_seq if !allow_spinmm/ | +11 | 0 replies | |
| 2/2 | mm/slab: use prandom if !allow_spinmm/ | +24 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH V2 0/2] fix lockdep warnings with kmalloc_nolock()
Hi, I've observed two lockdep warnings while testing kmalloc_nolock() in NMI:
1. Accessing current->mems_allowed_seq seqlock in NMI isn't safe and lockdep complains.
2. w/ CONFIG_SLAB_FREELIST_RANDOM, get_random_u32() acquires a local_lock, which isn't safe in NMI and could cause a deadlock.
Let's fix them.
Note: This is based on the latest slab/for-next. It wasn't clear to me if I should base it on slab/for-next or slab/for-next-fixes, because the merge window has started, this series needs some exposure in -next, and the patches in slab/for-next might land in mainline in the meantime.
But the conflict resolution should be trivial even if it should have been based on slab/for-next-fixes.
v1 -> v2:
- Patch 1: per Vlastimil's suggestion, do not access current->mems_allowed_seq and avoid retry if !allow_spin, rather than returning NULL.
v1: https://lore.kernel.org/linux-mm/[email protected]
Harry Yoo (2):
mm/slab: do not access current->mems_allowed_seq if !allow_spin mm/slab: use prandom if !allow_spin
mm/slub.c | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-)
base-commit: f6ed7e47c1fc78e78c9bfeb668b1ad9ba5c58120
Signature · 1 line
2.43.0