Re: [RFC PATCH] zram: avoid preemption with CPU-based compression backends

Barry Song <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.mm
Message-ID <CAGsJ_4wS1vhhrvk+BqLK++65ebENQE7yBPrM19q4HoRNEq2ckw@mail.gmail.com>
On Wed, Aug 5, 2026 at 3:31 PM Sergey Senozhatsky
<[email protected]> wrote:
>
> On (26/08/05 08:55), Barry Song (Xiaomi) wrote:
> > @@ -128,14 +128,20 @@ struct zcomp_strm *zcomp_stream_get(struct zcomp *comp)
> >                * so then unlock and re-try on the current CPU.
> >                */
> >               mutex_lock(&zstrm->lock);
> > +             if (!comp->ops->async && !IS_ENABLED(CONFIG_PREEMPT_RT))
> > +                     preempt_disable();
>
> We take slot_lock(), which is preemptible, under stream lock on
> some paths.

Hi Sergey,

As promised in [1], those patches are still under testing on real
Android phones. However, I'm quite curious which path takes
slot_lock while holding the zstream lock. My initial testing shows
that this path doesn't seem to be exercised at all. Also, after
inspecting the code, I couldn't find any path that does this.

[1] https://lore.kernel.org/all/CAGsJ_4wd60ok7BF9XGRiO6dvddkaYTziPV-Bxq+3mA+-c7MvQA@mail.gmail.com/

Best Regards
Barry
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.