mm/kmemleak: Avoid soft lockup in kmemleak_scan()
Status from this message: [merged mm-stable] mm-kmemleak-prevent-soft-lockup-in-first-object-iteration-loop-of-kmemleak_scan.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 2 repliesApplied 3/3
- v13 patches 8 repliesSuperseded
Changes in v2 from the cover letter
- Update patch 3 to count the objects checked instead of being gray for determining when to do cond_resched(). This is more reliable.
Patches in v2 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | mm/kmemleak: Use _irq lock/unlock variants in kmemleak_scan/_clear()mm/ | +8 | 0 replies | Applied |
| 2/3 | mm/kmemleak: Skip unlikely objects in kmemleak_scan() without taking lockmm/ | +14 | 0 replies | Applied |
| 3/3 | mm/kmemleak: Prevent soft lockup in first object iteration loop of kmemleak_scan()mm/ | +27 | 2 replies | Applied |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Muchun Song | Catalin Marinas |
|---|---|---|
| 1/3 | R-b | R-b |
| 2/3 | R-b | |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/3] mm/kmemleak: Avoid soft lockup in kmemleak_scan()
v2:
- Update patch 3 to count the objects checked instead of being gray for determining when to do cond_resched(). This is more reliable.
There are 3 RCU-based object iteration loops in kmemleak_scan(). Because of the need to take RCU read lock, we can't insert cond_resched() into the loop like other parts of the function. As there can be millions of objects to be scanned, it takes a while to iterate all of them. The kmemleak functionality is usually enabled in a debug kernel which is much slower than a non-debug kernel. With sufficient number of kmemleak objects, the time to iterate them all may exceed 22s causing soft lockup.
watchdog: BUG: soft lockup - CPU#3 stuck for 22s! [kmemleak:625]
This patch series make changes to the 3 object iteration loops in kmemleak_scan() to prevent them from causing soft lockup.
Waiman Long (3):
mm/kmemleak: Use _irq lock/unlock variants in kmemleak_scan/_clear() mm/kmemleak: Skip unlikely objects in kmemleak_scan() without taking
lock
mm/kmemleak: Prevent soft lockup in first object iteration loop of
kmemleak_scan()
mm/kmemleak.c | 60 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 11 deletions(-)
Signature · 1 line
2.31.1