*BAD*gran_size and MTRR

HPmoss

Member
May 8, 2023
32
0
6
Online
www.google.co.uk
Today I discovered following error/warning messages in the logs. Does this require any fix?

May 17 07:55:57 pve01 kernel: *BAD*gran_size: 16M chunk_size: 512M num_reg: 10 lose cover RAM: -274M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 16M chunk_size: 1G num_reg: 10 lose cover RAM: -242M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 16M chunk_size: 2G num_reg: 10 lose cover RAM: -1266M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 32M chunk_size: 256M num_reg: 10 lose cover RAM: -2M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 32M chunk_size: 512M num_reg: 10 lose cover RAM: -258M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 32M chunk_size: 1G num_reg: 10 lose cover RAM: -226M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 32M chunk_size: 2G num_reg: 10 lose cover RAM: -1250M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 64M chunk_size: 512M num_reg: 10 lose cover RAM: -226M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 64M chunk_size: 1G num_reg: 10 lose cover RAM: -162M
May 17 07:55:57 pve01 kernel: *BAD*gran_size: 64M chunk_size: 2G num_reg: 10 lose cover RAM: -1186M
.
.
.
May 17 07:55:57 pve01 kernel: mtrr_cleanup: can not find optimal value
May 17 07:55:57 pve01 kernel: please specify mtrr_gran_size/mtrr_chunk_size
May 17 07:55:57 pve01 kernel: pmd_set_huge: Cannot satisfy [mem 0xf0000000-0xf0200000] with a huge-page mapping due to MTRR override.
 
I've had an Intel motherboard that also could not cover all of the memory, regardless of what chunk_size or num_reg it used for MTRR. It's not a big issue as it will try every possible combination to minimize the amount of memory it cannot cover. You can choose the chunk_size or used num_reg so it does not have to try (and report) every possibility by setting those kernel parameters yourself (search mttr_ in the kernel documentation).
 
With an integrated GPU, you may find that changing the amount of RAM assigned to it in the BIOS (and consequently the amount of system RAM) will help the kernel determine optimal values of gran_size & chunk_size.
 
With an integrated GPU, you may find that changing the amount of RAM assigned to it in the BIOS (and consequently the amount of system RAM) will help the kernel determine optimal values of gran_size & chunk_size.
Do I need to do this manually (HOWTO?) or will it be taken care of by the kernel?
 
They are only warnings and not errors. It isn't necessary to address them but if you want to, the options as I remember it are:

1. Set explicit gran_size & chunk_size options in kernel boot parameters. In /etc/default/grub append to GRUB_CMDLINE_LINUX_DEFAULT.
This will prevent the verbose dmesg warnings re attempting to find optimal values but unless you can determine those 'optimal' values yourself, you still won't achieve full RAM cover.

2. Alternatively, if you have an iGPU, increase/decrease the amount of RAM allocated it in your BIOS. This will change slightly the amount of total RAM seen by the MTRR configuration attempt. Typically you don't need much video RAM on a server.

Either way, it may simply be the case that you lose some MTRR RAM cover and the amount is usually insignificant and these solutions simply remove the warnings rather than solve it.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!