From: Rusty Russell <rusty@rustcorp.com.au>
To: Andi Kleen <ak@muc.de>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Introduce load_TLS to the "for" loop.
Date: Wed, 14 Mar 2007 17:31:57 +1100 [thread overview]
Message-ID: <1173853917.19022.6.camel@localhost.localdomain> (raw)
In-Reply-To: <20070313135000.GA92373@muc.de>
On Tue, 2007-03-13 at 14:50 +0100, Andi Kleen wrote:
> On Tue, Mar 13, 2007 at 05:39:36PM +1100, Rusty Russell wrote:
> > GCC (4.1 at least) unrolls it anyway, but I can't believe this code
>
> Are you sure? Normally it doesn't unroll without -funroll-loops which
> the kernel does normally not set. Especially not with -Os builds.
Yep, checked again:
$ gcc --version
gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
...
...
gcc -Wp,-MD,arch/x86_64/kernel/.process.o.d -nostdinc
-isystem /usr/lib/gcc/i486-linux-gnu/4.1.2/include -D__KERNEL__
-Iinclude -include include/linux/autoconf.h -Wall -Wundef
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2
-mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe
-fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables
-funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
-maccumulate-outgoing-args -fno-omit-frame-pointer
-fno-optimize-sibling-calls -g -fno-stack-protector
-Wdeclaration-after-statement -Wno-pointer-sign -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(process)"
-D"KBUILD_MODNAME=KBUILD_STR(process)" -c -o
arch/x86_64/kernel/process.o arch/x86_64/kernel/process.c
...
$ objdump -Dr arch/x86_64/kernel/process.o | less
...
6be: 48 8b 94 00 00 00 00 mov 0x0(%rax,%rax,1),%rdx
6c5: 00
6c2: R_X86_64_32S cpu_gdt_descr+0x2
6c6: 48 8b 83 98 02 00 00 mov 0x298(%rbx),%rax
6cd: 48 83 c2 60 add $0x60,%rdx
6d1: 48 89 02 mov %rax,(%rdx)
6d4: 48 8b 83 a0 02 00 00 mov 0x2a0(%rbx),%rax
6db: 48 89 42 08 mov %rax,0x8(%rdx)
6df: 48 8b 83 a8 02 00 00 mov 0x2a8(%rbx),%rax
6e6: 48 89 42 10 mov %rax,0x10(%rdx)
If I turn on CONFIG_OPTIMIZE_FOR_SIZE, it's still unrolled,
interestingly.
Cheers,
Rusty.
prev parent reply other threads:[~2007-03-14 6:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-13 6:39 Rusty Russell
2007-03-13 13:50 ` Andi Kleen
2007-03-13 17:31 ` Jeremy Fitzhardinge
2007-03-13 20:55 ` Andi Kleen
2007-03-14 6:43 ` Rusty Russell
2007-03-14 6:31 ` Rusty Russell [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=1173853917.19022.6.camel@localhost.localdomain \
--to=rusty@rustcorp.com.au \
--cc=ak@muc.de \
--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
Powered by JetHome