mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Emmanuel Fleury <emmanuel.fleury@labri.fr>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: [patch] i386: use C code for current_thread_info()
Date: Mon, 12 Jun 2006 21:50:17 -0400	[thread overview]
Message-ID: <200606122152_MC3-1-C240-D8AE@compuserve.com> (raw)

In-Reply-To: <20060612184833.GA29177@rhlx01.fht-esslingen.de>

On Mon, 12 Jun 2006 20:48:33 +0200, Andreas Mohr 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*.

Hmmm.  The compiler does it this way:

  mov    %esp,%eax
  and    $0xffffe000,%eax

which could be faster because esp can be moved to eax while the mask
is being fetched.

-- 
Chuck


             reply	other threads:[~2006-06-13  1:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13  1:50 Chuck Ebbert [this message]
2006-06-13  6:43 ` Andreas Mohr
2006-06-13  9:27   ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2006-06-13  5:26 Albert Cahalan
2006-06-12 17:14 Chuck Ebbert
2006-06-12 17:55 ` Adrian Bunk
2006-06-12 18:48 ` Andreas Mohr
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=200606122152_MC3-1-C240-D8AE@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=andi@rhlx01.fht-esslingen.de \
    --cc=emmanuel.fleury@labri.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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®