diff options
author | Yosry Ahmed <yosryahmed@google.com> | 2025-01-13 22:44:58 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-01-16 06:15:43 +0100 |
commit | 779b9955f64327c339a16f68055af98252fd3315 (patch) | |
tree | 9b798f6e5170ad885db4f4fbc8d254057e40fa10 /mm/cma_debug.c | |
parent | mm: khugepaged: fix call hpage_collapse_scan_file() for anonymous vma (diff) | |
download | linux-779b9955f64327c339a16f68055af98252fd3315.tar.xz linux-779b9955f64327c339a16f68055af98252fd3315.zip |
mm: zswap: move allocations during CPU init outside the lock
In zswap_cpu_comp_prepare(), allocations are made and assigned to various
members of acomp_ctx under acomp_ctx->mutex. However, allocations may
recurse into zswap through reclaim, trying to acquire the same mutex and
deadlocking.
Move the allocations before the mutex critical section. Only the
initialization of acomp_ctx needs to be done with the mutex held.
Link: https://lkml.kernel.org/r/20250113214458.2123410-1-yosryahmed@google.com
Fixes: 12dcb0ef5406 ("mm: zswap: properly synchronize freeing resources during CPU hotunplug")
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/cma_debug.c')
0 files changed, 0 insertions, 0 deletions