LWN.net Logo

performance is not a reason to run 32bit kernel

performance is not a reason to run 32bit kernel

Posted May 27, 2008 17:20 UTC (Tue) by dlang (✭ supporter ✭, #313)
In reply to: performance is not a reason to run 32bit kernel by khim
Parent article: Kernel prepatch 2.6.26-rc4

not to mention the fact that in 32 bit mode you only have 8 registers available, but in 64 bit
mode you have 16 available.

most of the other architectures that have 32 bit and 64 bit options on the same chip have the
same number of registers available in both modes, so on those chips the increased code size
causes a performance hit (unless you need to access more ram), but on AMD64/x86_64 the number
of registers available doubles in 64 bit mode.


(Log in to post comments)

Not a big deal

Posted May 27, 2008 20:08 UTC (Tue) by khim (subscriber, #9252) [Link]

Surprisingly enough it's not a big deal for kernel. The whole system will be fast NOT when kernel will be uber-optimized and super-fast, but when kernel will use resources as sparingly as possible. Code in kernel does not perform extra-complex calculations so additional registers are not used much - they are mostly used to shorten prologue/epilogue for functions but then commands are longer on average in 64-bit mode so it's a wash. But memory manipulations are really-really hard to do for >2GB of RAM in 32bit mode: high/low memory, endless manipulations with page tables, etc. THIS affects system more then overhead from 32bit API emulation if this memory is actually used and if it's not used... why is it there?

Not a big deal

Posted May 27, 2008 21:12 UTC (Tue) by dlang (✭ supporter ✭, #313) [Link]

this does affect the kernel to some degree.

the kernel tries to use registers to pass parameters between functions (avoiding the overhead
of accessing the stack), more registers helps keep this efficiant rather then spilling over to
memory.

if you are accessing ram >4G the overhead of the PAE addressing will easily swamp this, but
even on relativly small memory sizes the fact that there are more registers free can be
noticable.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds