Skip to contentSkip to conversation

PAE/NX without performance drain?

DISCUSSION John Richard Moser 3 participants 8 messages Dec 9, 2006 – Dec 12, 2006

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Apparently (as I've been told today) using a hardware NX bit in a 32-bit x86 kernel requires PAE mode. PAE mode is enabled with HIGHMEM64, which is (apparently) extremely slow.

Is it possible to give some other way to get the hardware NX bit working in 32-bit mode, without the apparently massive performance penalty of HIGHMEM64?

- --
We will enslave their women, eat their children and rape their cattle!
-- Bosc, Evil alien overlord from the fifth dimension
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBRXsfAAs1xW0HCTEFAQIb3xAAhuVgOGGff6N3BQFUjej6PozDDcc56C2P pS+6JOdUaFWNfBbBg9FWbeGkW8thwNOfRRaTgE3TXar44djwd8rmjfFx9siWenue sYbdn61LYWsTRsRuS3noD49Dn3vj/sOv8pPEiz6ZPYd3kgkuipQHNVWUUjR7mne/ 9o5P4ajae4gcml7z3CcQVO8CkCFpCqQUPwXz2yVBPGEi4DEJHrNIlr8mbP2uBPkD nXcMY5KmHovDyueihoaVInzBdIhNGUSFEc6mfZS0bluCLaNUudWJCZDjEwunHS7M ngySKIQC2U3I0tgdok00Szum2NRlwclDNpoQP4x9577v/rCTVKfOxv+CioK+DXG2 QnYBPuicI31f2++itubnidLgCiBtjbuwHaz0OMMg9Ix7xws4WX2BLykuenRAxN9f F+TZuJJq8sD1CfTveomZq7UP8mpBECXB+HRTMNdpIy+QJ19Eg8p4N/l2pep1hvDv UA6tafSopIXEzcQKQ6Yi1MI8Du79O1zpTWzS+Hwgl+t3XfkI2e04wq7D4aN2ZMlw b3S3h6Lp4I9EgqPLBnu+s2/AkRa/AxZc3eGbgf8Fz75sbDYvRnuhXzSxAmmJru5D d51uB0GuHbiser+axWIj886pAOLPa2KGYpAjm7gtmVWFBNhzx5gnQRJkrxIcg4ew JOb4VR4yfB8=
=QCVY
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 6 lines · John Richard Moser

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Apparently (as I've been told today) using a hardware NX bit in a 32-bit x86 kernel requires PAE mode. PAE mode is enabled with HIGHMEM64, which is (apparently) extremely slow.

it's not extremely slow.

there is a minor performance delta, sure, but to be honest that's a benchmark thing more than a real life thing.

What did your measurements show that the slowdown was? And how did you measure this?

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Arjan van de Ven
Quoted 6 lines · John Richard Moser

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Apparently (as I've been told today) using a hardware NX bit in a 32-bit x86 kernel requires PAE mode. PAE mode is enabled with HIGHMEM64, which is (apparently) extremely slow.

Quoted 7 lines

it's not extremely slow.

there is a minor performance delta, sure, but to be honest that's a benchmark thing more than a real life thing.

What did your measurements show that the slowdown was? And how did you measure this?

I didn't measure, I was told by various people on IRC. Also Google has some misleading facts:

- Someone mentioned that HIGHMEM64G + 4G split costs 10%-30%. I immediately took that as "4G split might be friggin' expensive."

- In some discussions Ingo mentioned HIGHMEM64G re RT preemption being a huge performance delta; but I haven't found evidence that this isn't a bug in RT.

Too bad PAE can't be detected at boot time; someone else mentioned that some recent Pentium M laptops (and anything older than PPro) don't boot if PAE is on. Making 2 copies of the functions would be a pain in the ass; and using indirect addressing and function pointers would be... slow. In performance critical areas.

I want my hardware NX bit working in Ubuntu without having to recompile my kernel dammit. How do I swing this one past them? The performance I can argue; breaking 586 and some random laptops (I've been contacted by someone who has several of these Pentium-M machines that die on PAE) I can't do.

Quoted 4 lines

- --
We will enslave their women, eat their children and rape their cattle!
-- Bosc, Evil alien overlord from the fifth dimension
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBRXwo9ws1xW0HCTEFAQK7DA/+KOZavRjhhp0N8k+cj2E0YTT5f1HbV0wE mi0QqOwhR6VFg/8M+HGU5ytnmdXnNm5TyyTvxHfgEFaWpwMxWhAT0KZgP5twGc/9 f2uY9s600nvmDXnh9zKFsFBmIgJqdg++01cY9C6O2cl7xfTTvrzVXllZOBMtvKxh KmkHr0VVNhs2V4EYlEhKhMh2OAhYFtnUdd2VyV4d3snn4Y/Y/IneMM0GxULjGwg5 V7ATdJgs+s02iT8cRGFKbbn3H+0DtIxolIhlkvukPy0xfECtx/92HguLkLfq4o6I rRyP1n42vkY2wmKFtgnYU9CXBmd+1/GOmiVXk77+lID9xDQpWa5e3j4uB8o/StYv 6NMfj66Sc5yq/4+9lBB7awPA5gZkgBmYcTl4bvM5+FVxkr1pREUXzD589y9AEAoa fCVv0DXTZwDjYZBY9uFRZyRe0UVgPFwyBqq6S5QISXge242spGo6G9QJKj25vsMY JYdJb6f0EFzqwcFhYy+pp5s2NAId1lPT6SxhPq9aJ36enI8j4vJHPHSM8yBdVGSP g8OzFLb9EYTKvSzdTN1JwAMkGvwGKcfY+tEIEUlTEb0wqwEfA3rClWdb4ikEBl5D G2kjPqlGCdOXjIkijSzu8d6w7jPa+/EhdWRnBxuP/H7iKLWJoxaMqOR27nVx7/Fo OiJeilQNMMA=
=+GiD
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 5 lines

Too bad PAE can't be detected at boot time; someone else mentioned that some recent Pentium M laptops (and anything older than PPro) don't boot if PAE is on.

even Windows has 2 kernel binaries for this case btw, it's really really really hard.

Quoted 2 lines

I want my hardware NX bit working in Ubuntu without having to recompile my kernel dammit.

other distros ship a PAE enabled kernel, and use that for NX enabled machines (all NX capable machines support PAE obviously). I'm surprised Ubuntu doesn't, maybe ask them? (Or use a distro that does have this)

Signature · 2 lines
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 7 lines · Arjan van de Ven
Quoted 3 lines

Too bad PAE can't be detected at boot time; someone else mentioned that some recent Pentium M laptops (and anything older than PPro) don't boot if PAE is on.

even Windows has 2 kernel binaries for this case btw, it's really really really hard.

Yeah, I've been told Windows has 4 kernels (SMP/UP x PAE/NonPAE). In the case of a microkernel it'd be trivial; in the case of a monolith, you'd basically be shoehorning uK behavior in, probably by compiling both sets of functions and linking the appropriate set just-in-time (i.e. before entering protected mode). This would be an ugly hack.

Quoted 7 lines
Quoted 2 lines

I want my hardware NX bit working in Ubuntu without having to recompile my kernel dammit.

other distros ship a PAE enabled kernel, and use that for NX enabled machines (all NX capable machines support PAE obviously). I'm surprised Ubuntu doesn't, maybe ask them? (Or use a distro that does have this)

OpenSuSE and Fedora Core 6 both fail this; I checked the .config for the default kernels (by proxy on OpenSuSE 10.2; I asked someone) and ran my test case on FC6 (LiveCD from
http://www.fedoraunity.org/news-archives/fedora-core-6-zod-live-spins-released).

- --
We will enslave their women, eat their children and rape their cattle!
-- Bosc, Evil alien overlord from the fifth dimension
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBRXx0eQs1xW0HCTEFAQIgvA/+PEGnseTwVbvk7OidaUc6aISYEwrp8vMs nIZ+tJ5wB4bDkXbMPDE2TcrGwJiBsRapLw777QR//5xMww+Lnt0egXmpJhBWFcDu VL+s0UxSukC/JcASKX3S/lYzhjjkSXkbEoaeqgq9ZRL/v49P8zsYCIJx39M20oOR +qIv7TuC3LRPeZmJMiTDMIKzheAdzwofAfuV+7UfTOJB8dYHapHDQ4qZjEzUXr/K FV/XjN2E9icSFeDgoE6KB6N5nVzpr9WkmXMIccy0HR148Ky2ee04y9/3Pdr40glG +dNeDPwPxQEigv2GN21fxPNdYGu2JBX2/LadxJ9EB38g0xGjzT67NwEmUrBxyHOl 8I8mZTPiqf9+f1NpHMFo5jIFynaaaKS/F34TYa30CSULMZ8cRsCPK8Jk5JAFI2ay NZofsjGZ2YwZVd8HkZVeDgBC38XHXwHmi0y4ZV2tMmwQrOe4c6Nr7U9J6CCMNK2c nQVSjV94uAn8I0qCqG/NkkrBtVnc8XdYOXkwvkA2BM0vFTRhKC/UaYX73yBvJm09 4QNnWAOI0p78gWMoXYmowXggcI1ERc2ca2I+rVQRF7hsWbcco7SAdcItpbn+k1xl w/Fr0ZhgVKSc7M1Nd/zIZ3e7uhF7xqUMd3kcqDcbu/SF4Fvalpww00Db99oZ5J08 sPSFno97ScM=
=pjHt
-----END PGP SIGNATURE-----

#5 lore raw
Quoted 6 lines
Quoted 1 line

OpenSuSE and Fedora Core 6 both fail this; I checked the .config for the default kernels (by proxy on OpenSuSE 10.2; I asked someone) and ran my test case on FC6 (LiveCD from
http://www.fedoraunity.org/news-archives/fedora-core-6-zod-live-spins-released).

liveCD's don't count since they pick the most common kernel; afaik fedora has a kernel-PAE and installs this on the NX capable machines...

Signature · 2 lines
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org
#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · Arjan van de Ven
Quoted 4 lines

OpenSuSE and Fedora Core 6 both fail this; I checked the .config for the default kernels (by proxy on OpenSuSE 10.2; I asked someone) and ran my test case on FC6 (LiveCD from
http://www.fedoraunity.org/news-archives/fedora-core-6-zod-live-spins-released).

liveCD's don't count since they pick the most common kernel; afaik fedora has a kernel-PAE and installs this on the NX capable machines...

Nods. No such thing in Ubuntu; and they just tore out most of their kernels due to management overhead, saying that you should install the BigIron (giant x86 servers with tens of gigs of memory) kernel if you want PAE. Of course, the BigIron kernel is for a server and doesn't have nice low-latency features (our default desktop kernel is a 250HZ VOLUNTARY_PREEMPT one, the low-latency kernel has 1000HZ PREEMPT; I always thought 1000HZ PREEMPT was a good desktop default).

Things like preempt or PAE adjustment at boot time are awesome pipe dreams, but none of them are awesomely possible/easy. Distro maintainers don't seem to want to supply 30 combinations ....

- --
We will enslave their women, eat their children and rape their cattle!
-- Bosc, Evil alien overlord from the fifth dimension
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBRXx2hQs1xW0HCTEFAQJM7xAAk1UAT/wYkgUISc6OlIfc/iWv1R34KXZM zlbmfWBT3+mR7KgkF2e2TeADLhHlSjgMUzwG4X4rzt2W4PSk1A7kN/aPw1Qd7N+9 YaOK+4gsdCE9La5hcIgHB/uFcYNk5hLlOxvMR0oGW3p8u28F3SRolXm4O/jUfjkm dkAGJInLL6o69zsg2zw7FhJQtLpw36XsHxJzM7hnvvmeP4uZ4Zhmil0MmG/0vK/I cBPw0W6RTWuvFQymRsTdHLMMdkakzMAPL+y09qpgvSFO43SqWXMEXSJK4LdFZDot PRT6J1Mb6ZwpXIgdM85PUwLXacaKzb8TGUy+XP7qeKSNaVeQzybDQg7cE0g5rEuh 15V8bJyrErKWMypxX3xikD/FG0nbBjQrIVgJZX6ZN8W5RFetpWii9qYlkgYqJu5V T/+FxQGOU1PrsP2QNGPL1uPr+MDIPmGopD8Ap2knqeMMT/uEMa/5YKLu7Q4UPjkI xBStmqHAsiZKt6VIybzqGmLHep0K20xPHKvwZ4E9j7R7uJz0uJID54eA+UvL8QDd Nd/Df0xIB912w9VKaSIwlZgWDexh2nfI1kxCA1w9BH0oLEZq/2ly6Te2KStx1khT J///xiPdMkn0oTHZepKqaFGKqDgtYvULM1HURZLbO6z+rUslqupDBzSvQcj40kTT yjxCcrKqLgU=
=KSx+
-----END PGP SIGNATURE-----

#7 lore raw
In reply to John Richard Moser
Quoted 9 lines · John Richard Moser
Quoted 4 lines

other distros ship a PAE enabled kernel, and use that for NX enabled machines (all NX capable machines support PAE obviously). I'm surprised Ubuntu doesn't, maybe ask them? (Or use a distro that does have this)

OpenSuSE and Fedora Core 6 both fail this; I checked the .config for the default kernels (by proxy on OpenSuSE 10.2; I asked someone) and ran my test case on FC6 (LiveCD from
http://www.fedoraunity.org/news-archives/fedora-core-6-zod-live-spins-released).

The livecd has a single kernel I believe. The 'real' FC6 release has both a PAE and non-PAE kernel as Arjan described.

Dave

Signature · 1 line
http://www.codemonkey.org.uk