DRM Buddy & AMDGPU Wired Up For Clear Page Tracking In Linux 6.10

Written by Michael Larabel in Linux Kernel on 1 May 2024 at 03:00 AM EDT. 5 Comments
LINUX KERNEL
Sent in to DRM-Next as part of last week's drm-misc-next changes is implementing support for tracking cleared free memory and is initially wired up for the AMDGPU kernel graphics driver.

AMD engineers have been working on implementing "clear page" tracking functionality for the DRM buddy allocator. This feature is used for tracking cleared free memory and while not-yet-merged there's also been a patch for working on defragmentation support that relies on the clear page functionality.

The DRM buddy allocator can be used by different Direct Rendering Manager drivers but for DRM-Next the initial user of this clear page functionality is just the AMDGPU driver.

The prior patch series by AMD's Arunpravin Paneer Selvam further adds:
- Add tracking clear page feature.

- Driver should enable the DRM_BUDDY_CLEARED flag if it successfully clears the blocks in the free path. On the otherhand, DRM buddy marks each block as cleared.

- Track the available cleared pages size

- If driver requests cleared memory we prefer cleared memory but fallback to uncleared if we can't find the cleared blocks. when driver requests uncleared memory we try to use uncleared but fallback to cleared memory if necessary.

- When a block gets freed we clear it and mark the freed block as cleared, when there are buddies which are cleared as well we can merge them. Otherwise, we prefer to keep the blocks as separated.

This clear page feature in the DRM buddy code and AMDGPU driver is part of this drm-misc-next pull going into the Linux 6.10 kernel once that merge window opens up later this month.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week