Re: [PATCHv4 01/17] zram: switch to non-atomic entry locking
From: Sergey Senozhatsky
Date: Thu Feb 06 2025 - 03:29:26 EST
On (25/02/06 09:26), Sebastian Andrzej Siewior wrote:
> On 2025-02-06 17:17:41 [+0900], Sergey Senozhatsky wrote:
> > > Okay. So there are requirements for the sleeping lock. A mutex isn't
> > > fitting the requirement because it is too large I guess.
> >
> > Correct.
>
> I would nice to state this why a generic locking implementation can not
> be used. From what I have seen it should play along with RT nicely.
Will do.
> > > > wait_on_bit_lock() has might_sleep().
> > >
> > > My point exactly. This makes the WARN_ON_ONCE() obsolete.
> >
> > Right, might_sleep() can be disabled, as far as I understand,
> > via CONFIG_DEBUG_ATOMIC_SLEEP, unlike WARN_ON_ONCE(). But I
> > can drop it and then just rely on might_sleep(), should be
> > enough.
>
> It should be enough. mutex_lock(), down() and so on relies solely on it.
> As I said, preemptible() only works on preemptible kernels if it comes
> to the preemption counter on and !preemptible kernels with enabled
> debugging.
Ack.