Commit 5a4d894
cachestat: do not flush stats in recency check
syzbot detects that cachestat() is flushing stats, which can sleep, in its
RCU read section (see [1]). This is done in the workingset_test_recent()
step (which checks if the folio's eviction is recent).
Move the stat flushing step to before the RCU read section of cachestat,
and skip stat flushing during the recency check.
[1]: https://lore.kernel.org/cgroups/[email protected]/
Link: https://lkml.kernel.org/r/[email protected]
Fixes: b006847 ("mm: workingset: move the stats flush into workingset_test_recent()")
Signed-off-by: Nhat Pham <[email protected]>
Reported-by: [email protected]
Closes: https://lore.kernel.org/cgroups/[email protected]/
Debugged-by: Johannes Weiner <[email protected]>
Suggested-by: Johannes Weiner <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Acked-by: Shakeel Butt <[email protected]>
Cc: Al Viro <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: "Huang, Ying" <[email protected]>
Cc: Kairui Song <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: Ryan Roberts <[email protected]>
Cc: Yosry Ahmed <[email protected]>
Cc: <[email protected]> [6.8+]
Signed-off-by: Andrew Morton <[email protected]>1 parent 9fd154b commit 5a4d894
3 files changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
| 357 | + | |
| 358 | + | |
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4248 | 4248 | | |
4249 | 4249 | | |
4250 | 4250 | | |
| 4251 | + | |
| 4252 | + | |
| 4253 | + | |
4251 | 4254 | | |
4252 | 4255 | | |
4253 | 4256 | | |
| |||
4311 | 4314 | | |
4312 | 4315 | | |
4313 | 4316 | | |
4314 | | - | |
| 4317 | + | |
4315 | 4318 | | |
4316 | 4319 | | |
4317 | 4320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
415 | 416 | | |
416 | 417 | | |
417 | 418 | | |
418 | | - | |
| 419 | + | |
| 420 | + | |
419 | 421 | | |
420 | 422 | | |
421 | 423 | | |
| |||
467 | 469 | | |
468 | 470 | | |
469 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
470 | 477 | | |
471 | 478 | | |
472 | 479 | | |
473 | | - | |
| 480 | + | |
| 481 | + | |
474 | 482 | | |
475 | 483 | | |
476 | 484 | | |
| |||
558 | 566 | | |
559 | 567 | | |
560 | 568 | | |
561 | | - | |
| 569 | + | |
562 | 570 | | |
563 | 571 | | |
564 | 572 | | |
| |||
0 commit comments