linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: cgroups@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Zefan Li <lizefan.x@bytedance.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/2] cgroup: Use irqsave in cgroup_rstat_flush_locked().
Date: Tue, 1 Mar 2022 20:38:51 -1000	[thread overview]
Message-ID: <Yh8Q+wjgk6dkDphR@slm.duckdns.org> (raw)
In-Reply-To: <20220301122143.1521823-2-bigeasy@linutronix.de>

Hello,

On Tue, Mar 01, 2022 at 01:21:42PM +0100, Sebastian Andrzej Siewior wrote:
> All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock
> either with spin_lock_irq() or spin_lock_irqsave().
> cgroup_rstat_flush_locked() itself acquires cgroup_rstat_cpu_lock which
> is a raw_spin_lock. This lock is also acquired in cgroup_rstat_updated()
> in IRQ context and therefore requires _irqsave() locking suffix in
> cgroup_rstat_flush_locked().
> Since there is no difference between spin_lock_t and raw_spin_lock_t
> on !RT lockdep does not complain here. On RT lockdep complains because
> the interrupts were not disabled here and a deadlock is possible.
> 
> Acquire the raw_spin_lock_t with disabled interrupts.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Can you please add a comment explaining why irqsave is being used? As it
stands, it just looks spurious.

Thanks.

-- 
tejun


  reply	other threads:[~2022-03-02  6:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[PATCH 0/2] Correct locking assumption on PREEMPT_RT>
     [not found] ` <20220301122143.1521823-1-bigeasy@linutronix.de>
2022-03-01 12:21   ` Sebastian Andrzej Siewior
2022-03-02  6:38     ` Tejun Heo [this message]
2022-03-02 14:46       ` [PATCH] cgroup: Add a comment to cgroup_rstat_flush_locked() Sebastian Andrzej Siewior
2022-03-02 15:47         ` Tejun Heo
2022-03-01 12:21   ` [PATCH 2/2] mm: workingset: Replace IRQ-off check with a lockdep assert Sebastian Andrzej Siewior

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=Yh8Q+wjgk6dkDphR@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan.x@bytedance.com \
    --cc=tglx@linutronix.de \
    /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