Skip to contentSkip to conversation

3.6-rc7 32-bit PAE miscalculates dirty page limits

DISCUSSION Pierre Beck 3 participants 7 messages Sep 30, 2012 – Oct 1, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

there seems to be a bug in either ext4 or VM code triggered with 16 GB memory when compiled with 32-bit and PAE. dirty_background_ratio defaults to 10, dirty_ratio to 20. But in effect, dirty pages are strongly limited (zero or negative?). I observed extreme I/O wait states and slow disk access. A quick cure was to set dirty_bytes and dirty_background_bytes to sane values, overriding the ratios. An educated guess: the result of dirty_ratio calculation is stored as an unsigned 32-bit integer and overflows?

Greetings,

Pierre Beck

#1 lore raw
Quoted 11 lines · Pierre Beck

Hi,

there seems to be a bug in either ext4 or VM code triggered with 16 GB memory when compiled with 32-bit and PAE. dirty_background_ratio defaults to 10, dirty_ratio to 20. But in effect, dirty pages are strongly limited (zero or negative?). I observed extreme I/O wait states and slow disk access. A quick cure was to set dirty_bytes and dirty_background_bytes to sane values, overriding the ratios. An educated guess: the result of dirty_ratio calculation is stored as an unsigned 32-bit integer and overflows?

Seriously, why are you running a 32-bit kernel on memory sizes this large? Yes, in theory it should work up to 64 GB but claims are that the kernel doesn't even boot if you try...

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#2 lore raw

Hi,

when I installed the original setup, there were no 64-bit PC CPUs. It's been kept up-to-date, changed hardware whenever necessary. But a shift from 32-bit to 64-bit isn't as simple as it seems.

I tried 64-bit kernel with 32-bit userspace. It failed. The installed DVB-S tuner driver messed up the stream. I *guess* there's some little / big endian issue between userspace program (vdr, dvbhddevice) and driver (sff716x_ff which is still in experimental media stack), and it *may* be resolved by upgrading userspace to 64-bit as well.

I do consider the option of upgrading to 64-bit userspace. My distribution Debian doesn't provide a clean way to do so in-place, though. There are HOWTOs on the topic with warnings varying between 'do not attempt, will eat your data' and 'worked for the author, YMMV'. That scared me off for now. Instead, a clean install and copying /etc will be my best option and with LVM in place I'm sure I will eventually upgrade sooner or later.

Personally, I don't need a fix anyways, since I found the stated workaround and can live with that. But what about other folks who upgrade their PC? They won't know what hit them when their new PC crawls because disk is trashed.

Greetings,

Pierre Beck

Quoted 16 lines · H. Peter Anvin
Quoted 11 lines · Pierre Beck

Hi,

there seems to be a bug in either ext4 or VM code triggered with 16 GB memory when compiled with 32-bit and PAE. dirty_background_ratio defaults to 10, dirty_ratio to 20. But in effect, dirty pages are strongly limited (zero or negative?). I observed extreme I/O wait states and slow disk access. A quick cure was to set dirty_bytes and dirty_background_bytes to sane values, overriding the ratios. An educated guess: the result of dirty_ratio calculation is stored as an unsigned 32-bit integer and overflows?

Seriously, why are you running a 32-bit kernel on memory sizes this large? Yes, in theory it should work up to 64 GB but claims are that the kernel doesn't even boot if you try...

-hpa

#3 lore raw
Quoted 2 lines · Pierre Beck

But what about other folks who upgrade their PC? They won't know what hit them when their new PC crawls because disk is trashed.

I don't know, maybe backup their data, install a nice 64-bit Linux distro of their liking along with a 64-bit kernel which is several magnitudes more tested than its 32-bit counterpart, copy their data back and forget 32-bit ever existed...

:-)

Signature · 2 lines
Regards/Gruss,
    Boris.
#4 lore raw
Quoted 9 lines · Borislav Petkov
Quoted 2 lines · Pierre Beck

But what about other folks who upgrade their PC? They won't know what hit them when their new PC crawls because disk is trashed.

I don't know, maybe backup their data, install a nice 64-bit Linux distro of their liking along with a 64-bit kernel which is several magnitudes more tested than its 32-bit counterpart, copy their data back and forget 32-bit ever existed...

It is very sad, though, that there are still drivers which don't work correctly in compat mode. Please report bugs on those -- that is just not acceptable.

Unfortunately few distros provide 64-bit kernels for their 32-bit distros, which acerbates the problem.

-hpa

#5 lore raw
Quoted 6 lines · H. Peter Anvin

It is very sad, though, that there are still drivers which don't work correctly in compat mode. Please report bugs on those -- that is just not acceptable.

Unfortunately few distros provide 64-bit kernels for their 32-bit distros, which acerbates the problem.

Yes, the other way 'round, 32-bit userspace on 64-bit kernels should work. And fixed if not.

Thanks.

Signature · 2 lines
Regards/Gruss,
    Boris.
#6 lore raw
Quoted 11 lines · Borislav Petkov
Quoted 6 lines · H. Peter Anvin

It is very sad, though, that there are still drivers which don't work correctly in compat mode. Please report bugs on those -- that is just not acceptable.

Unfortunately few distros provide 64-bit kernels for their 32-bit distros, which acerbates the problem.

Yes, the other way 'round, 32-bit userspace on 64-bit kernels should work. And fixed if not.

That is the same way around (32-bit kernel, 64-bit userspace obviously is a nonstarter.)

-hpa