8000 Give memory back automatically: a page_reporting driver for UML · Issue #506 · nixidae/nixidae · GitHub
[go: up one dir, main page]

Skip to content

Give memory back automatically: a page_reporting driver for UML #506

Closed

Description

@Lillecarl

The second half of #505. The mconsole balloon is landed and works, but it is a knob: a test has to call drop_caches() and then shrink(), and it only takes pages that are already free.

CONFIG_PAGE_REPORTING is generic mm and arch-independent. A driver in arch/um that registers a page_reporting_dev_info and calls os_drop_memory on each scatterlist entry gives the same effect continuously and with no host orchestration -- the guest reports free blocks as it frees them, and growing back is free because the memory file is sparse. That is what virtio-balloon's free-page-reporting rides on, minus the virtio.

Shape of the work:

  • ~80 lines in arch/um/drivers, carried as a patch in pkgs/uml-kernel until it is upstream.
  • Check PAGE_REPORTING_MIN_ORDER against pageblock_order: reporting is per high-order block, 2 MiB on x86, so it will not reclaim a scattered page cache the way shrink does after drop_caches. The two are complementary, not one replacing the other.
  • The syscall stub page is written into the memory file at boot and mapped into every guest process. Confirm it is reserved and can never reach a free list.
  • tests/memory.py already measures both sides. The new assertion is that host_memory_kib() falls on its own after the guest frees memory, with nothing called.

Upstream-shaped work. Consult before anything goes to the UML list.


Assisted-By: Opus 5

Activity

  1. added
    source: vivarium
    on Oct 19, 2026
  2. transferred this issue fromnixidae/vivariumon Oct 19, 2026
  3. added theissue type on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: vivarium

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0