Skip to contentSkip to conversation

i386: use C code for current_thread_info()

PATCH Chuck Ebbert 2 participants 2 messages Jun 11, 2006

lore
Share & tools
lore
#0 lore raw

In-Reply-To: <[email protected]>

Quoted 6 lines · Linus Torbalds
Quoted 2 lines · Chuck Ebbert

Using C code for current_thread_info() lets the compiler optimize it.

Ok, me likee. I just worry that this might break some older gcc version. Have you checked with gcc-3.2 or something?

I just tried gcc 3.3.3 and the kernel gets a little bigger but it boots and runs OK. That's the oldest compiler I can find.

text data bss dec hex filename

3593627  559864  342728 4496219  449b5b 2.6.17-rc6-32-post/vmlinux
3591371  559864  342728 4493963  44928b 2.6.17-rc6-32/vmlinux

+2256

Looking at the generated code, it seems the compiler just makes dumb choices and tends to recompute current_thread_info() in unlikely code paths even when there is no register pressure. 4.0.2 makes better choices.

Signature · 1 line
Chuck
#1 lore raw
Quoted 5 lines · Chuck Ebbert

I just tried gcc 3.3.3 and the kernel gets a little bigger but it boots and runs OK. That's the oldest compiler I can find.

text data bss dec hex filename

Quoted 8 lines
3593627  559864  342728 4496219  449b5b 2.6.17-rc6-32-post/vmlinux
3591371  559864  342728 4493963  44928b 2.6.17-rc6-32/vmlinux

+2256

Looking at the generated code, it seems the compiler just makes dumb choices and tends to recompute current_thread_info() in unlikely code paths even when there is no register pressure. 4.0.2 makes better choices.

What size with gcc 4.1.2 ? (just curiosity)

Regards

Signature · 5 lines
Emmanuel Fleury              | Office: 211
Associate Professor,         | Phone: +33 (0)5 40 00 35 24
LaBRI, Domaine Universitaire | Fax:   +33 (0)5 40 00 66 69
351, Cours de la Libération  | email: [email protected]
33405 Talence Cedex, France  | URL: http://www.labri.fr/~fleury