2006-12-09 20:39:32

by John Richard Moser

[permalink] [raw]
Subject: PAE/NX without performance drain?

-----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-----


2006-12-10 09:38:01

by Arjan van de Ven

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

On Sat, 2006-12-09 at 15:39 -0500, John Richard Moser wrote:
> -----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?



2006-12-10 15:34:20

by John Richard Moser

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

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



Arjan van de Ven wrote:
> On Sat, 2006-12-09 at 15:39 -0500, John Richard Moser wrote:
>> -----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?

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.

>
>
>
>

- --
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-----

2006-12-10 19:40:07

by Arjan van de Ven

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?


>
> 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.

> 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)

--
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

2006-12-10 20:56:29

by John Richard Moser

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

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



Arjan van de Ven wrote:
>> 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.

>> 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-----

2006-12-10 21:00:33

by Arjan van de Ven

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

> >
>
> 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...

--
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

2006-12-10 21:05:15

by John Richard Moser

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

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



Arjan van de Ven wrote:
>> 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-----

2006-12-11 04:48:43

by Chuck Ebbert

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

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

On Sat, 09 Dec 2006 15:39:30 -0500, John Richard Moser wrote:

> 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?

If your hardware can run the x86_64 kernel, try using that with your
i386 userspace. It works here...

--
Chuck
"Even supernovas have their duller moments."

2006-12-11 04:58:05

by John Richard Moser

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

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



Chuck Ebbert wrote:
> In-Reply-To: <[email protected]>
>
> On Sat, 09 Dec 2006 15:39:30 -0500, John Richard Moser wrote:
>
>> 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?
>
> If your hardware can run the x86_64 kernel, try using that with your
> i386 userspace. It works here...
>

I hear that breaks USB printing. Also I'm interested in getting it
working for other people, i.e. shipping with working NX.

- --
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

iQIVAwUBRXzlVgs1xW0HCTEFAQKGcQ//Q91/SNOSQQkRdOQLf6KAYfKbKSt5b9qm
EgpH7TdeJyFq+pZb90BKd0Sr7h245vr2q4+xufuZ51gxMIqc/+UZ6D0bttUbcE10
Pja/i0s3havWMccEs/60NqnM8xnV82IOUZORBPJKVoBo39pHBOGyRjkBJFjVOjQO
8baJN67fa1gTPxvnhS1Xb7LqxpJqGLygjCieofFxxLh7UJbvOVNoJLXyphMNA3AE
uwrut3HDLTPw7XW/klc1y8bFIOVf1RI9YLUiQZJPcyBTaEKntuFOzVbE1X1J5CDj
/96JE+oqqg+Y3ysyJY1kv7Rwo+zWAr/ARTcK+q9UlJXFabWDSb9WC6mS612YhISM
gus3P76oFZ27irVHHVlDKM6V9Uk7B2S5fZnjaiLV+yQ9IlxVInQohjn2aPpp+7Oj
zfWogpjjVMyWNnOdJ1PttvH2OCykNuMmE+YclsXt5GH8HobLlnOCBdfZYnH9hYmm
N//EoRC7HEX2mDcV0LwIhHiWOQxoPnhB3qDQnG1F/KNK7MYF9mpDtryoptDmu2y/
568V2sm/bx9JOKb7Dy5p2k8SAApUCnGZKVQ+JRJ7FxoIMpOZd5MVGy1cROroJW/x
LCuHNjm+tttMBuzn4R9LACp6QdNdW58ygbwzAL9HuHTeOtJjAVwdrvKOLjMCk23Q
qHv5gZB4NLs=
=ijVN
-----END PGP SIGNATURE-----

2006-12-11 05:42:24

by Randy Dunlap

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

On Sun, 10 Dec 2006 23:58:00 -0500 John Richard Moser wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
> Chuck Ebbert wrote:
> > In-Reply-To: <[email protected]>
> >
> > On Sat, 09 Dec 2006 15:39:30 -0500, John Richard Moser wrote:
> >
> >> 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?
> >
> > If your hardware can run the x86_64 kernel, try using that with your
> > i386 userspace. It works here...
> >
>
> I hear that breaks USB printing. Also I'm interested in getting it
> working for other people, i.e. shipping with working NX.

Where's the USB printing bug report?

---
~Randy

2006-12-11 13:34:12

by Matthew Garrett

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

On Sun, Dec 10, 2006 at 11:46:44PM -0500, Chuck Ebbert wrote:

> If your hardware can run the x86_64 kernel, try using that with your
> i386 userspace. It works here...

Losing vm86() support can cause problems.

--
Matthew Garrett | [email protected]

2006-12-12 18:03:42

by Dave Jones

[permalink] [raw]
Subject: Re: PAE/NX without performance drain?

On Sun, Dec 10, 2006 at 03:56:26PM -0500, John Richard Moser wrote:

> > 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

--
http://www.codemonkey.org.uk