Closed cnuke closed 7 months ago
Fixed in Genode 23.11.
The real fix is still not merged.
Commit cfe7915573a5a7c998c07f7c346b456dfee46b21 implements page-struct management per DMA buffer. Repositories for allwinner, imx, rpi, and zynq were also adapted for the change. NOw I cross fingers for nightly. Also, any test results for Pinephone and MNT Reform are much appreciated.
I briefly tested the glmark2 preset on the PinePhone with the current staging branch. It works with the page-struct commits but after the sixth scenario the gpu driver fails to upgrade the Platform
session and issues a RAM resource request of 16M
. When I revert cfe7915 and 06b00b5 it finishes successfully without any resource request.
I can look into that later this week.
@chelmuth commit 74c561f appears to solve the unexpected memory consumption. I'll will give the MNT Reform 2 a spin next.
The MNT Reform 2 also plays ball if the aforementioned fixup is applied (otherwise the imx8mq_gpu_drv
requests more caps).
Due to the way the memory-allocation code is currently implemented and the
struct page
object handling is integrate aliasing that has unexpected side-effects can occur. Sincestruct page
objects are created for a page-size aligned address [1] when requested, allocations that fall within the same virtual page address range share the same object.Such objects are created lazy and and life-time management is only performed via ref-counting when the page API [2] (
alloc_pages
,free_pages
etc.) is used. Since the current implementation removesstruct page
objects [3] when performing allocations still referenced objects can become invalid and can be corrupted as the memory is re-used.[1] https://github.com/genodelabs/genode/blob/73771669f1c3a2c01555ebc01c7741b5a37b3d51/repos/dde_linux/src/lib/lx_emul/virt_to_page.c#L20-L37
[2] shadow/mmc/page_alloc.c
[3] https://github.com/genodelabs/genode/blob/73771669f1c3a2c01555ebc01c7741b5a37b3d51/repos/dde_linux/src/lib/lx_emul/alloc.cc#L20-L25