[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1173853917.19022.6.camel@localhost.localdomain>
Date: Wed, 14 Mar 2007 17:31:57 +1100
From: Rusty Russell <rusty@...tcorp.com.au>
To: Andi Kleen <ak@....de>
Cc: lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Introduce load_TLS to the "for" loop.
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists