Re: [PATCH] zram: Replace bit spinlocks with spinlock_t for PREEMPT_RT.
From: Jens Axboe
Date: Wed Jun 19 2024 - 13:34:42 EST
On 6/19/24 9:08 AM, Sebastian Andrzej Siewior wrote:
> From: Mike Galbraith <umgwanakikbuti@xxxxxxxxx>
>
> The bit spinlock disables preemption. The spinlock_t lock becomes a sleeping
> lock on PREEMPT_RT and it can not be acquired in this context. In this locked
> section, zs_free() acquires a zs_pool::lock, and there is access to
> zram::wb_limit_lock.
>
> Use a spinlock_t on PREEMPT_RT for locking and set/ clear ZRAM_LOCK bit after
> the lock has been acquired/ dropped.
The conditional code depending on CONFIG_PREEMPT_RT is nasty. Why not
just get rid of that and use the CONFIG_PREEMPT_RT variants for
everything? They are either good enough to work well in general, or it
should be redone such that it is.
--
Jens Axboe