[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0901200754100.2974@localhost.localdomain>
Date: Tue, 20 Jan 2009 08:01:52 +1100 (EST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Nick Piggin <npiggin@...e.de>
cc: Ingo Molnar <mingo@...e.hu>,
Bernd Schmidt <bernds_cb1@...nline.de>,
Andi Kleen <andi@...stfloor.org>,
David Woodhouse <dwmw2@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Harvey Harrison <harvey.harrison@...il.com>,
"H. Peter Anvin" <hpa@...or.com>,
Chris Mason <chris.mason@...cle.com>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
paulmck@...ux.vnet.ibm.com, Gregory Haskins <ghaskins@...ell.com>,
Matthew Wilcox <matthew@....cx>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-btrfs <linux-btrfs@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Morreale <pmorreale@...ell.com>,
Sven Dietrich <SDietrich@...ell.com>, jh@...e.cz
Subject: Re: gcc inlining heuristics was Re: [PATCH -v7][RFC]: mutex: implement
adaptive spinning
On Mon, 19 Jan 2009, Nick Piggin wrote:
>
> I want to know what is the problem with the restrict keyword?
> I'm sure I've read Linus ranting about how bad it is in the
> past...
No, I don't think I've ranted about 'restrict'. I think it's a reasonable
solution for performance-critical code, and unlike the whole type-aliasing
model, it actually works for the _sane_ cases (ie doing some operation
over two arrays of the same type, and letting the compiler know that it
can access the arrays without fearing that writing to one would affect
reading from the other).
The problem with 'restrict' is that almost nobody uses it, and it does
obviously require programmer input rather than the compiler doing it
automatically. But it should work well as a way to get Fortran-like
performance from HPC workloads written in C - which is where most of the
people are who really want the alias analysis.
> it seems like a nice opt-in thing that can be used where the aliases are
> verified and the code is particularly performance critical...
Yes. I think we could use it in the kernel, although I'm not sure how many
cases we would ever find where we really care.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists