Skip to content

Huge page statistics may be incorrect or pages are not being allocated as expected #240

Description

@arthurp

This bug is on #236, but is expected to be left as future work, so will need a fix after that PR merges.

The kernel can and will allocate huge pages when running with vm.huge_mapping_enabled=false. However, some tests fail because the detected number of pages reported in /proc/memstat is not as expected. Sometimes it reads a page less than expected and sometimes 0. The computation function also appears to be called more often that the userspace file is read.

Here is a test I was using to investigate: mmap_hugepages.c

I see two possible things causing this:

  • Pages are not being allocated correctly as huge pages (15 when 16 is expected) and huge pages are being spontaneously split making future statistics be 0.
  • The statistics are incorrectly computed. This could be because the page tables are being incorrectly scanned, for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions