Re: [PATCH v5 4/5] drm/xe: Set TTM device beneficial_order to 9 (2M)

From: Thomas Hellström

Date: Thu May 07 2026 - 07:20:31 EST


On Tue, 2026-05-05 at 20:32 -0700, Matthew Brost wrote:
> Set the TTM device beneficial_order to 9 (2M), which is the sweet
> spot for Xe when attempting reclaim on system memory BOs, as it
> matches
> the large GPU page size. This ensures reclaim is attempted at the
> most
> effective order for the driver.
>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Dave Chinner <david@xxxxxxxxxxxxx>
> Cc: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
> Cc: Roman Gushchin <roman.gushchin@xxxxxxxxx>
> Cc: Muchun Song <muchun.song@xxxxxxxxx>
> Cc: David Hildenbrand <david@xxxxxxxxxx>
> Cc: Lorenzo Stoakes <ljs@xxxxxxxxxx>
> Cc: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx>
> Cc: Vlastimil Babka <vbabka@xxxxxxxxxx>
> Cc: Mike Rapoport <rppt@xxxxxxxxxx>
> Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> Cc: Michal Hocko <mhocko@xxxxxxxx>
> Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
> Cc: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> Cc: Kairui Song <kasong@xxxxxxxxxxx>
> Cc: Barry Song <baohua@xxxxxxxxxx>
> Cc: Axel Rasmussen <axelrasmussen@xxxxxxxxxx>
> Cc: Yuanchu Xie <yuanchu@xxxxxxxxxx>
> Cc: Wei Xu <weixugc@xxxxxxxxxx>
> Cc: linux-mm@xxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: Thomas Hellström <thomas.hellstrom@xxxxxxxxxxxxxxx>
> Cc: Carlos Santa <carlos.santa@xxxxxxxxx>
> Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
> Signed-off-by: Matthew Brost <matthew.brost@xxxxxxxxx>
> Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxxxxxxx>

Reviewed-by: Thomas Hellström <thomas.hellstrom@xxxxxxxxxxxxxxx>


> ---
>  drivers/gpu/drm/xe/xe_device.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_device.c
> b/drivers/gpu/drm/xe/xe_device.c
> index 4b45b617a039..3f719ab08d1c 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -500,7 +500,8 @@ struct xe_device *xe_device_create(struct pci_dev
> *pdev,
>  
>   err = ttm_device_init(&xe->ttm, &xe_ttm_funcs, xe->drm.dev,
>         xe->drm.anon_inode->i_mapping,
> -       xe->drm.vma_offset_manager, 0);
> +       xe->drm.vma_offset_manager,
> +      
> TTM_ALLOCATION_POOL_BENEFICIAL_ORDER(get_order(SZ_2M)));
>   if (WARN_ON(err))
>   return ERR_PTR(err);
>