panfrost: Add madvise support to BO cache

Graphics / Mesa 3D Graphics Library / Mesa - Rob Herring [kernel.org] - 20 August 2019 00:33 EDT

The kernel now supports madvise ioctl to indicate which BOs can be freed when there is memory pressure. Mark BOs purgeable when they are in the BO cache. The BOs must also be munmapped when they are in the cache or they cannot be purged.

We could optimize avoiding the madvise ioctl on older kernels once the driver version bump lands, but probably not worth it given the other driver features also being added.

d0ec5d38f6c panfrost: Add madvise support to BO cache
src/gallium/drivers/panfrost/pan_bo_cache.c | 21 +++++++++++++++++++++
src/gallium/drivers/panfrost/pan_drm.c | 4 ++--
2 files changed, 23 insertions(+), 2 deletions(-)

Upstream: cgit.freedesktop.org


  • Share