public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>,
	Mike Galbraith <umgwanakikbuti@gmail.com>,
	Minchan Kim <minchan@kernel.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] zram: Replace bit spinlocks with spinlock_t for PREEMPT_RT.
Date: Fri, 24 Mar 2023 13:07:50 +0900	[thread overview]
Message-ID: <20230324040750.GE3271889@google.com> (raw)
In-Reply-To: <20230323161830.jFbWCosd@linutronix.de>

On (23/03/23 17:18), Sebastian Andrzej Siewior wrote:
> From: Mike Galbraith <umgwanakikbuti@gmail.com>
> 
> 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.
> 
> Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Link: https://lkml.kernel.org/r/YqIbMuHCPiQk+Ac2@linutronix.de
> ---
> 
> I'm simply forwarding Mike's patch here. The other alternative is to let
> the driver depend on !PREEMPT_RT. I can't tell likely it is that this
> driver is used. Mike most likely stumbled upon it while running LTP.

Yeah, I'm curious if anyone uses zram in preempt-rt systems. I don't
mind this patch but would be nice to add new code when it solves some
real problems. Maybe `depend on !PREEMPT_RT` can be a better option.

  reply	other threads:[~2023-03-24  4:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 16:18 [PATCH] zram: Replace bit spinlocks with spinlock_t for PREEMPT_RT Sebastian Andrzej Siewior
2023-03-24  4:07 ` Sergey Senozhatsky [this message]
2023-03-24  4:32   ` Mike Galbraith
  -- strict thread matches above, loose matches on Subject: below --
2024-06-19 15:08 Sebastian Andrzej Siewior
2024-06-19 17:34 ` Jens Axboe
2024-06-19 17:52   ` Sebastian Andrzej Siewior
2024-06-19 18:01     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230324040750.GE3271889@google.com \
    --to=senozhatsky@chromium.org \
    --cc=axboe@kernel.dk \
    --cc=bigeasy@linutronix.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=umgwanakikbuti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox