public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	stable@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andreas Larsson <andreas@gaisler.com>,
	Ludwig Rydberg <ludwig.rydberg@gaisler.com>
Subject: Re: [for-next][PATCH 2/2] atomic64: Use arch_spin_locks instead of raw_spin_locks
Date: Wed, 22 Jan 2025 18:57:01 +0100	[thread overview]
Message-ID: <20250122175701.GA34562@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250122105517.4f80bf23@gandalf.local.home>

On Wed, Jan 22, 2025 at 10:55:17AM -0500, Steven Rostedt wrote:

> > >  s64 generic_atomic64_read(const atomic64_t *v)
> > >  {
> > >  	unsigned long flags;
> > > -	raw_spinlock_t *lock = lock_addr(v);
> > > +	arch_spinlock_t *lock = lock_addr(v);
> > >  	s64 val;
> > >  
> > > -	raw_spin_lock_irqsave(lock, flags);
> > > +	local_irq_save(flags);
> > > +	arch_spin_lock(lock);  
> > 
> > Note that this is not an equivalent change. It's probably sufficient,
> > but at the very least the Changelog should call out what went missing
> > and how that is okay.
> 
> What exactly is the difference here that you are talking about? I know that
> raw_spin_lock_irqsave() has lots of different variants depending on the
> config options, but I'm not sure which you are talking about? Is it the fact
> that you can't do the different variants with this?

If I followed the maze right, then I get something like:

raw_spin_lock_irqsave(lock, flags)
  local_irq_save(flags);
  preempt_disable();
  arch_spin_lock(lock);
  mmiowb_spin_lock();


And here you leave out that preempt_disable() and mmiowb stuff. The
former is fine because local_irq_save() already makes things
non-preemptible and there are no irq-state games. The mmiowb thing is
fine because nothing inside this critical section cares about mmio.


  reply	other threads:[~2025-01-22 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250121201942.978460684@goodmis.org>
2025-01-21 20:19 ` [for-next][PATCH 1/2] ring-buffer: Do not allow events in NMI with generic atomic64 cmpxchg() Steven Rostedt
2025-01-21 20:19 ` [for-next][PATCH 2/2] atomic64: Use arch_spin_locks instead of raw_spin_locks Steven Rostedt
2025-01-22 10:14   ` Peter Zijlstra
2025-01-22 15:55     ` Steven Rostedt
2025-01-22 17:57       ` Peter Zijlstra [this message]
2025-01-22 19:31         ` Steven Rostedt

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=20250122175701.GA34562@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=andreas@gaisler.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludwig.rydberg@gaisler.com \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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