All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Santos <danielfsantos@att.net>
To: Rob Landley <rob@landley.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christopher Li <sparse@chrisli.org>,
	David Daney <david.daney@cavium.com>,
	David Howells <dhowells@redhat.com>,
	David Rientjes <rientjes@google.com>,
	Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	Ingo Molnar <mingo@kernel.org>, Joe Perches <joe@perches.com>,
	Konstantin Khlebnikov <khlebnikov@openvz.org>,
	linux-doc@vger.kernel.org, linux-sparse@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Paul Turner <pjt@google.com>, Pavel Pisa <pisa@cmp.felk.cvut.cz>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Richard Weinberger <richard@nod.at>,
	Steven Rostedt <rostedt@goodmis.org>,
	Suresh Siddha <suresh.b.siddha@intel.com>
Subject: Re: [PATCH v4 0/13] Generic Red-Black Trees
Date: Sun, 24 Jun 2012 19:33:44 -0500	[thread overview]
Message-ID: <4FE7B1E8.4030002@att.net> (raw)
In-Reply-To: <4FE69A14.6040904@landley.net>

Rob,

Thank you for the education.  I wasn't up on the "anti-tivoization"
issue, but after reading up I would have to say that I'm deeply in that
camp; if I buy the hardware, I should be able to do what I damn well
please with it -- why I haven't purchased an iphone for example.    At
the same time, I also believe in GPL w/link-time exception if the
situation warrants it.  But this is a discussion for another time & place.

On 06/23/2012 11:39 PM, Rob Landley wrote:
> Less optimized but still works with old compilers is fine. (Less
> optimized comes with the territory with old compilers.) 
This was of particular concern to be because of how much less
optimized.  For example, an inline function that expanded to about 128
bytes on gcc 4.6 expanded to 500-ish bytes on gcc 3.4.6.  I guess I
should reserve any further comment until I have hard performance numbers.
> And who's talking "if"?
>
> LLVM/CLANG builds a bootabe linux kernel:
> http://lwn.net/Articles/441018/
>
> Open64 builds a bootable linux kernel:
> http://article.gmane.org/gmane.comp.compilers.open64.devel/2498
>
> The PCC guys make an adorable token effort which is largely ignored:
> http://bsdfund.org/bundle/
>
> Heck, Fabrice bellard did it himself with tinycc back in 2004:
> http://bellard.org/tcc/tccboot.html
Frankly, I'm glad to hear about these endeavors.  I'm not a fan of Apple
because of their business policies, but I'm a huge fan of run-time
optimization being a hard-core Java programmer (and yes, I admit it :). 
I did check out tccboot at one point out of interest.
>> Another question that has to be asked is "Is Linux ready for this?"  The
>> answer today may be "yes" or "no", but to say that it can never be ready
>> is pure folly.
>
> I'm saying that adding complexity is not necessarily an improvement, and
> that over-optimizing at the expense of portability may turn out to be a
> mistake in the long run.
Any time you want to add complexity, it must be justified. However, I'm
operating by the compiler compatibility rules adopted by the Linux
kernel project and putting portability (to non-gcc compilers) as a lower
concern than the 99% use case.
> You keep using the word "paradigm". Voluntarily. I find this odd.
I don't tend to back away from a word just because PHBs (Pointy-Haired
Bosses) like to abuse them.  I'll even use the word "synergistic" when I
think it applies.  What I'm proposing introduces a few new paradigms,
patterns or schools of thought(and I prefer to pronounce it
"pair-uh-dig-uh-me", just because I can).

For one, I'm asking people to use a macro where you leave parameters
empty as a sort of "default" value.  This isn't standard and if I'm
going to ask somebody(especially lots of people) to do something
non-standard I want to make sure I've explored it thoroughly, eliminated
all other options and that there's a really good reason for doing so. 
If I can prove that there's a good reason for doing it, that there are
no other reasonable options, that it has a benefit and is reusable, then
we're using a new paradigm and we have to start thinking about the
interface differently than we're used to thinking about interfaces. 
Many consider this out-right macro abuse -- that is a valid school of
thought.  I'm introducing this as an alternate school of thought.

But the other paradigm that seems to be new is using constant function
pointers for a sort-of "type-injection" for generic inline functions. 
We usually think about function pointers as overhead.  But since gcc's
-findirect-inlining feature has matured, it creates the opportunity for
a new way of thinking about the use of function pointers (when they are
constant) for generic code.  I prefer the term "paradigm" when mechanism
requires a distinct way of thinking about the mechanism and its
components and can be re-used as a pattern.

> So yay standard C99 micro stuff. I'm a little worried about being able
> to unwrap it all and understand what's going on, but unlike templates
> we have cc -E to fall back on here, so ok.
I have (or had) a script somewhere around here to parse that huge
one-line macro out and give it some reasonable linebreaks & indentation
(feeding it gcc -E).  Developing complex pre-processor stuff is a super
pain, so I just want to make sure that using it is as painless as possible.
> Ok, so "designed with gcc 4.6's optimizer in mind, regression tested back to 3.4 for at least minimal functionality, and not intentionally breaking other compilers".
>
> That's what I wanted to know, and it sounds good to me.
Yes.  I wouldn't think it appropriate to propose the patch set if it
degraded performance with a fairly recent compiler (stable).  Although,
gcc 4.6.3 still isn't considered "stable" on Gentoo because there's
still a few (10-ish) broken packages blocking it.

Daniel



      parent reply	other threads:[~2012-06-25  0:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-23  4:00 [PATCH v4 0/13] Generic Red-Black Trees Daniel Santos
2012-06-23  4:00 ` [PATCH v4 1/13] compiler-gcc4.h: Correct verion check for __compiletime_error Daniel Santos
2012-06-23  4:00 ` [PATCH v4 2/13] compiler-gcc4.h: Reorder macros based upon gcc ver Daniel Santos
2012-06-23  4:00 ` [PATCH v4 3/13] compiler-gcc.h: Add gcc-recommended GCC_VERSION macro Daniel Santos
2012-06-23  4:00 ` [PATCH v4 4/13] compiler-gcc{3,4}.h: Use " Daniel Santos
2012-06-23  4:00 ` [PATCH v4 5/13] compiler{,-gcc4}.h: Remove duplicate macros Daniel Santos
2012-06-23  4:00 ` [PATCH v4 6/13] bug.h: Replace __linktime_error with __compiletime_error Daniel Santos
2012-06-25 18:16   ` Paul Gortmaker
2012-06-25 18:16     ` Paul Gortmaker
2012-06-25 19:30     ` Daniel Santos
2012-06-23  4:00 ` [PATCH v4 7/13] compiler{,-gcc4}.h: Introduce __flatten function attribute Daniel Santos
2012-06-23  4:00 ` [PATCH v4 8/13] bug.h: Make BUILD_BUG_ON generate compile-time error Daniel Santos
2012-06-23  4:00 ` [PATCH v4 9/13] bug.h: Add BUILD_BUG_ON_NON_CONST macro Daniel Santos
2012-06-23  4:00 ` [PATCH v4 10/13] bug.h: Add gcc 4.2+ versions of BUILD_BUG_ON_* macros Daniel Santos
2012-06-23  4:00 ` [PATCH v4 11/13] rbtree.h: Generic Red-Black Trees Daniel Santos
2012-06-27 13:00   ` Peter Zijlstra
2012-06-23  4:00 ` [PATCH v4 12/13] fair.c: Use generic rbtree impl in fair scheduler Daniel Santos
2012-06-26 12:15   ` Peter Zijlstra
2012-06-26 21:59     ` Daniel Santos
2012-06-27 12:36       ` Peter Zijlstra
2012-06-23  4:00 ` [PATCH v4 13/13] documentation for rbtrees Daniel Santos
2012-06-23 23:01 ` [PATCH v4 0/13] Generic Red-Black Trees Rob Landley
2012-06-24  0:40   ` Daniel Santos
2012-06-24  4:39     ` Rob Landley
2012-06-24  7:57       ` Pavel Pisa
2012-06-24 23:29         ` Rob Landley
2012-06-25  8:35         ` Daniel Santos
2012-06-24 16:06       ` Alan Cox
2012-06-25  0:33       ` Daniel Santos [this message]

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=4FE7B1E8.4030002@att.net \
    --to=danielfsantos@att.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.santos@pobox.com \
    --cc=david.daney@cavium.com \
    --cc=dhowells@redhat.com \
    --cc=hpa@zytor.com \
    --cc=joe@perches.com \
    --cc=khlebnikov@openvz.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=pisa@cmp.felk.cvut.cz \
    --cc=pjt@google.com \
    --cc=richard@nod.at \
    --cc=rientjes@google.com \
    --cc=rob@landley.net \
    --cc=rostedt@goodmis.org \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=sparse@chrisli.org \
    --cc=suresh.b.siddha@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.