All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Daniel Santos <daniel.santos@pobox.com>
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: Sat, 23 Jun 2012 18:01:08 -0500	[thread overview]
Message-ID: <4FE64AB4.1010904@landley.net> (raw)
In-Reply-To: <1340424048-7759-1-git-send-email-daniel.santos@pobox.com>

On 06/22/2012 11:00 PM, Daniel Santos wrote:
> Theory of Operation
> ===================
> Historically, genericity in C meant function pointers, the overhead of a
> function call and the inability of the compiler to optimize code across
> the function call boundary.  GCC has been getting better and better at
> optimization and determining when a value is a compile-time constant and
> compiling it out.  As of gcc 4.6, it has finally reached a point where
> it's possible to have generic search & insert cores that optimize
> exactly as well as if they were hand-coded. (see also gcc man page:
> -findirect-inlining)

For those of us who stopped upgrading gcc when it went to a non-open
license, and the people trying to escape to llvm/pcc/open64/tcc/qcc/etc
and build the kernel with that, this will simply be "less optimized"
rather than "you're SOL, hail stallman"?

> Layer 2: Type-Safety
> --------------------
> In order to achieve type-safety of a generic interface in C, we must
> delve deep into the darkened Swamps of The Preprocessor and confront the
> Prince of Darkness himself: Big Ugly Macro.  To be fair, there is an
> alternative solution (discussed in History & Design Goals), the
> so-called "x-macro" or "supermacro" where you #define some pre-processor
> values and include an unguarded header file.  With 17 parameters, I
> choose this solution for its ease of use and brevity, but it's an area
> worth debate.

Because this is just _filling_ me with confidence about portability and
c99 compliance.

(Or I suppose C11!!one! compliance. The new thing that puts asserts in
the base language and makes u8 a keyword since _that_ won't break
existing code and putting utf8 string constants within quotes wasn't
previously possible.)

I'm not saying the standard's perfect, I'm saying a web page that ties
itself to mozilla at the expense of working on firefox, let alone
chrome, might be a bit short-sighted these days. XFree86 begat x.org,
OpenOffice begat libre, etc. The FSF went nuts again and this time
around EGCS is called LLVM, so talking about gcc 4.6-only features
thrills some of us less than you might expect.

I suppose sparse has to be able to cope with this, so that's something...

> To avoid needing multiple versions of the macro, we use a paradigm

Indeed.

I still have trouble remembering how trampolines work when I wander away
for a while. Oh well...

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

  parent reply	other threads:[~2012-06-23 23:01 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 ` Rob Landley [this message]
2012-06-24  0:40   ` [PATCH v4 0/13] Generic Red-Black Trees 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

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=4FE64AB4.1010904@landley.net \
    --to=rob@landley.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=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.