[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7aab574e-b6ba-4038-802f-2d64af09d802@paulmck-laptop>
Date: Sat, 4 May 2024 11:18:43 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Boqun Feng <boqun.feng@...il.com>, Marco Elver <elver@...gle.com>,
	Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Dmitry Vyukov <dvyukov@...gle.com>,
	syzbot <syzbot+b7c3ba8cdc2f6cf83c21@...kaller.appspotmail.com>,
	linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com,
	Nathan Chancellor <nathan@...nel.org>,
	Arnd Bergmann <arnd@...nel.org>, Al Viro <viro@...iv.linux.org.uk>,
	Jiri Slaby <jirislaby@...nel.org>
Subject: Re: [PATCH v3] tty: tty_io: remove hung_up_tty_fops
On Sat, May 04, 2024 at 10:50:29AM -0700, Linus Torvalds wrote:
> On Fri, 3 May 2024 at 22:08, Paul E. McKenney <paulmck@...nel.org> wrote:
> >
> > You are right, this is going to need some arch-specific code for a few
> > of the architectures.  Hey, I was hoping!!!
> >
> > The compilers do not currently optimize these things, but things appear
> > to me to be heading in that direction.
> 
> Ok, so it sounds like right now it makes no sense - presumably
> __atomic_load_n() doesn't actually generate better code than
> READ_ONCE() does as-is, and we have the issue with having to make it
> per-architecture anyway.
> 
> But maybe in a couple of years we can revisit this when / if it
> actually generates better code and is more widely applicable.
Completely agreed.
Here is my current thoughts for possible optimizations of non-volatile
memory_order_relaxed atomics:
o	Loads from the same variable that can legitimately be
	reordered to be adjacent to one another can be fused
	into a single load.
o	Stores to the same variable that can legitimately be
	reordered to be adjacent to one another can be replaced
	by the last store in the series.
o	Loads and stores may not be invented.
o	The only way that a computation based on the value from
	a given load can instead use some other load is if the
	two loads are fused into a single load.
Anything that I am missing?
							Thanx, Paul
Powered by blists - more mailing lists
 
