mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Emmanuel Fleury <emmanuel.fleury@labri.fr>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch] i386: use C code for current_thread_info()
Date: Mon, 12 Jun 2006 20:48:33 +0200	[thread overview]
Message-ID: <20060612184833.GA29177@rhlx01.fht-esslingen.de> (raw)
In-Reply-To: <200606121317_MC3-1-C23A-4F2D@compuserve.com>

Hi,

On Mon, Jun 12, 2006 at 01:14:34PM -0400, Chuck Ebbert wrote:
> Kernel code starts out ~30K bytes smaller with gcc 4.1 and using C
> for current_thread_info() helps even more than with 4.0.  Nice...

Especially since current_thread_info() often has an AGI stall (read:
severe pipeline stall) since it often cannot properly intermingle
with nearby opcodes due to lack of suitable ones, e.g. at a
function prologue.
mov    $0xffffe000,%eax
and    %esp,%eax
are fundamentally incompatible due to having to wait for the address
generation before the "and" can be executed.
This shows up during profiling quite noticeably (IIRC 8 hits vs. 1 to 2
hits on other places), which really hurts since this function is used
basically *everywhere*.
As such whatever optimization we can gain (e.g. the compiler merging
multiple current_thread_info() invocations) is very worthwhile.
I've come up with this C variant recently, too, but I didn't think
it would make too much of a difference, however it seems it's really
useful when going towards newer gcc versions. 

Andreas Mohr

-- 
No programming skills!? Why not help translate many Linux applications! 
https://launchpad.ubuntu.com/rosetta
(or alternatively buy nicely packaged Linux distros/OSS software to help
support Linux developers creating shiny new things for you?)

  parent reply	other threads:[~2006-06-12 18:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 17:14 Chuck Ebbert
2006-06-12 17:55 ` Adrian Bunk
2006-06-12 18:48 ` Andreas Mohr [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-13  5:26 Albert Cahalan
2006-06-13  1:50 Chuck Ebbert
2006-06-13  6:43 ` Andreas Mohr
2006-06-13  9:27   ` Avi Kivity
2006-06-11 20:43 Chuck Ebbert
2006-06-11 21:05 ` Emmanuel Fleury
2006-06-11 19:07 Chuck Ebbert
2006-06-11 19:33 ` Linus Torvalds
2006-06-11 19:42 ` Jan Engelhardt
2006-06-11 20:33   ` Jan Engelhardt
2006-06-11 20:44   ` Alistair John Strachan
2006-06-12  8:10     ` Andi Kleen

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=20060612184833.GA29177@rhlx01.fht-esslingen.de \
    --to=andi@rhlx01.fht-esslingen.de \
    --cc=76306.1226@compuserve.com \
    --cc=emmanuel.fleury@labri.fr \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®