Yosry Ahmed a76da30fc2 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>
2025-01-14 20:51:25 -08:00
..
2024-11-07 14:38:07 -08:00
2024-11-03 01:28:06 -05:00
2023-12-12 10:11:32 +01:00
2024-11-18 18:10:37 -08:00
2024-11-27 11:13:25 -08:00
2022-10-03 14:02:43 -07:00
2024-11-11 00:26:44 -08:00
2024-09-03 21:15:31 -07:00
2024-11-05 16:56:26 -08:00
2024-08-15 22:16:14 -07:00
2024-07-10 12:14:54 -07:00
2024-11-25 16:51:24 -08:00
2024-11-07 14:38:07 -08:00
2023-04-12 17:36:23 -07:00
2024-12-18 19:04:42 -08:00
2024-12-18 19:04:45 -08:00
2024-04-25 20:55:48 -07:00
2024-04-25 20:55:48 -07:00