Commit 46ac16e
committed
Merge: mm: migrate high-order folios in swap cache correctly
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/3851
The following commit fixes an issue that causes tasks to hang on attempting to take mm->mmap_lock
commit fc346d0
Author: Charan Teja Kalla <quic_charante@quicinc.com>
Date: Thu Dec 14 04:58:41 2023 +0000
mm: migrate high-order folios in swap cache correctly
Large folios occupy N consecutive entries in the swap cache instead of
using multi-index entries like the page cache. However, if a large folio
is re-added to the LRU list, it can be migrated. The migration code was
not aware of the difference between the swap cache and the page cache and
assumed that a single xas_store() would be sufficient.
This leaves potentially many stale pointers to the now-migrated folio in
the swap cache, which can lead to almost arbitrary data corruption in the
future. This can also manifest as infinite loops with the RCU read lock
held.
JIRA: https://issues.redhat.com/browse/RHEL-23654
Signed-off-by: Nico Pache <npache@redhat.com>
Approved-by: Waiman Long <longman@redhat.com>
Approved-by: Donald Dutile <ddutile@redhat.com>
Merged-by: Lucas Zampieri <lzampier@redhat.com>1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
| |||
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
| 437 | + | |
436 | 438 | | |
437 | 439 | | |
| 440 | + | |
438 | 441 | | |
439 | 442 | | |
440 | 443 | | |
| |||
444 | 447 | | |
445 | 448 | | |
446 | 449 | | |
447 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
448 | 455 | | |
449 | 456 | | |
450 | 457 | | |
| |||
0 commit comments