mtrr_cleanup: can not find optimal value, perhaps no longer needed?

Bug #1163587 reported by Bryan Quigley on 2013-04-02
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)

Bug Description

The actual common error message from dmesg:

[ 0.000000] original variable MTRRs
[ 0.000000] reg 0, base: 0GB, range: 32GB, type WB
[ 0.000000] reg 1, base: 3584MB, range: 512MB, type UC
[ 0.000000] reg 2, base: 3548MB, range: 4MB, type UC
[ 0.000000] reg 3, base: 3552MB, range: 32MB, type UC
[ 0.000000] total RAM covered: 32220M
[ 0.000000] gran_size: 64K chunk_size: 64K num_reg: 7 lose cover RAM: 28676M
[ 0.000000] gran_size: 64K chunk_size: 128K num_reg: 7 lose cover RAM: 28676M
[ 0.000000] gran_size: 64K chunk_size: 256K num_reg: 7 lose cover RAM: 28676M
[ 0.000000] gran_size: 64K chunk_size: 512K num_reg: 7 lose cover RAM: 28676M
[ 0.000000] gran_size: 64K chunk_size: 1M num_reg: 7 lose cover RAM: 28676M
[ 0.000000] gran_size: 256M chunk_size: 2G num_reg: 6 lose cover RAM: 220M
[ 0.000000] gran_size: 512M chunk_size: 512M num_reg: 5 lose cover RAM: 476M
[ 0.000000] gran_size: 512M chunk_size: 1G num_reg: 5 lose cover RAM: 476M
[ 0.000000] gran_size: 512M chunk_size: 2G num_reg: 5 lose cover RAM: 476M
[ 0.000000] gran_size: 1G chunk_size: 1G num_reg: 5 lose cover RAM: 476M
[ 0.000000] gran_size: 1G chunk_size: 2G num_reg: 5 lose cover RAM: 476M
[ 0.000000] gran_size: 2G chunk_size: 2G num_reg: 4 lose cover RAM: 1500M
[ 0.000000] mtrr_cleanup: can not find optimal value
[ 0.000000] please specify mtrr_gran_size/mtrr_chunk_size

I have found errors like this on many machines (one with 128 GB of RAM, mine with just 4GB). The instructions want you to specify kernel options that you don't need to do. Just turning off mtrr_cleanup appears to be the best option. You can fix it be specifying disable_mtrr_cleanup.

According to kernel paramaters (

 disable_mtrr_cleanup [X86]
   The kernel tries to adjust MTRR layout from continuous
   to discrete, to make X server driver able to add WB
   entry later. This parameter disables that.

From this I understand it was here to help allow leave the X server space if it needed it in the future. That should no longer be necessary, correct? I have an Intel GPU and noticed no performance problems by disabling it.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: linux-image-3.8.0-16-generic 3.8.0-16.26
ProcVersionSignature: Ubuntu 3.8.0-16.26-generic 3.8.5
Uname: Linux 3.8.0-16-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.9.2-0ubuntu5
Architecture: amd64
 /dev/snd/controlC0: bryan 1978 F.... pulseaudio
Date: Tue Apr 2 16:56:13 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-02-04 (56 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20130204.1)
MachineType: Dell Inc. Inspiron 1545
MarkForUpload: True
 PATH=(custom, no user)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.8.0-16-generic root=UUID=0983e077-6f15-4e52-a776-faa186229dc8 ro quiet splash vt.handoff=7
 linux-restricted-modules-3.8.0-16-generic N/A
 linux-backports-modules-3.8.0-16-generic N/A
 linux-firmware 1.104
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install) 12/07/2009
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A14 0G848F
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA14:bd12/07/2009:svnDellInc.:pnInspiron1545:pvr:rvnDellInc.:rn0G848F:rvr:cvnDellInc.:ct8:cvr: Inspiron 1545
dmi.sys.vendor: Dell Inc.

Bryan Quigley (bryanquigley) wrote :

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to . Please test the latest v3.9 kernel[0] (Not a kernel in the daily directory) and install both the linux-image and linux-image-extra .deb packages.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.


Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Bryan Quigley (bryanquigley) wrote :

Marked it as kernel-bug-exists-upstream, but I should point out that it could be "fixed" by simply disabling mtrr_cleanup in the kernel build (so it might be an Ubuntu config choice?).

tags: added: kernel-bug-exists-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Andy Whitcroft (apw) wrote :

This was enabled because many machines do not have spance for an MTRR for the AGP Gart space. Without one we are unable to switch the graphics display memory into Write Combining mode with a serious performance hit. The errors in your case seem to be benign as I assume you have sufficient space to make this entry anyway. The errors are simply reported to the kernel log and for most people this is not seen, I do not believe they would be given any popup or asked to file a bug. Given the upsides for those affected by the lack of space, I think this is a positive option in the main.

Changed in linux (Ubuntu):
status: Confirmed → Triaged
Bryan Quigley (bryanquigley) wrote :

Is there a good way to identify a machine that is helped by having this on? I'm curious as to what kind of hardware requires mtrr_cleanup to perform well.

The 128 GB RAM Machine, did result in some RAM lost, but it wasn't significant considering it has 128 GB of RAM (around 128 MB loss if memory serves me). If this improves graphical performance significantly for many machines, it's probably worth the loss for machines with huge amounts of RAM.

Does switching the graphics memory to Write Combining originate in KMS now (instead of Xorg)?

Bryan Quigley (bryanquigley) wrote :

It seems MTRR support is being deprecated now -, commit 2baa891e42d84159b693eadd44f6fe1486285bdc.

Perhaps disabling MTRR (as opposed to just mtrr_cleanup) might be considered for xenial? I believe it may affect boot time when the cleanup is ran.

tags: added: xenial
removed: raring
Bryan Quigley (bryanquigley) wrote :

My testing could not find any difference in boot time using systemd's tools.

Bryan Quigley (bryanquigley) wrote :

From my latest testing, we do currently support machines that don't have PAT support (really old 32 bit x86). So this can be revisited at some future point when we go 64 bit only for x86.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers