Files
reims-vgpu/docs
Anees Iqbal 51be62538b 🐛 Wait out a fold in flight before an import looks at its pages
A fold of the views reads the imports' holds once, as it takes the views'
lock, then maps the runs no hold covers through dma-bufs. An import's hold
went into its table under no lock a fold holds, so a hold made while a fold
ran was missed: the import looked at where its pages lie before the fold
mapped them, found them mapped from their files, and handed rt their pointer,
which the fold then remapped as a VM_PFNMAP mapping. A driver that takes a
pointer's pages again once their mapping changed, as Intel's do (the fold
probe in docs/lessons.md), finds no pages there at the import's next use.

A hold now waits for a fold in flight once it is recorded, so the import's
look sees what that fold mapped and takes the dma-buf path, and a later fold
reads the hold. Folds run only at the views' budget, near vm.max_map_count,
or where the kernel refuses a map at its limit of mappings.

The test holds a fold in flight across an import's hold; with the wait taken
out it fails ("the import's look after its hold missed what the fold
mapped"), on homelab-um870-1 with udmabuf.
2026-12-02 06:10:00 -08:00
..