* TTM evicting same-vm bos
@ 2025-05-13 9:14 Hellstrom, Thomas
2025-05-16 11:12 ` Christian König
0 siblings, 1 reply; 2+ messages in thread
From: Hellstrom, Thomas @ 2025-05-13 9:14 UTC (permalink / raw)
To: christian.koenig@amd.com
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
Brost, Matthew, Auld, Matthew
Hi, Christian
During eviction we want to be able to evict bos that share the VM's
reservation object but that are currently not bound to the VM since
they are not part of the current working set.
TTM can't handle this situation since it's not aware of whether a bo is
bound to a VM or not.
Do you have a preference of how to address this? One idea would be to
forward the operation ctx to the eviction_valuable callback. Another to
add an "unbound" flag to the bo and an "unbound_only" flag to the
operation ctx.
Any feedback appreciated.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: TTM evicting same-vm bos
2025-05-13 9:14 TTM evicting same-vm bos Hellstrom, Thomas
@ 2025-05-16 11:12 ` Christian König
0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2025-05-16 11:12 UTC (permalink / raw)
To: Hellstrom, Thomas
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
Brost, Matthew, Auld, Matthew
Hi Thomas,
sorry for the delayed reply.
On 5/13/25 11:14, Hellstrom, Thomas wrote:
> Hi, Christian
>
> During eviction we want to be able to evict bos that share the VM's
> reservation object but that are currently not bound to the VM since
> they are not part of the current working set.
>
> TTM can't handle this situation since it's not aware of whether a bo is
> bound to a VM or not.
That's not 100% true.
We already have support for something similar for the KFD as well, see function amdgpu_ttm_bo_eviction_valuable():
/* If bo is a KFD BO, check if the bo belongs to the current process.
* If true, then return false as any KFD process needs all its BOs to
* be resident to run successfully
*/
dma_resv_for_each_fence(&resv_cursor, bo->base.resv,
DMA_RESV_USAGE_BOOKKEEP, f) {
if (amdkfd_fence_check_mm(f, current->mm) &&
!(place->flags & TTM_PL_FLAG_CONTIGUOUS))
return false;
}
But to be honest I never really liked that approach because it abuses the fact that KFD fences are bound to the struct mm.
Additional to that we have a few flags in the context object which allows to evict BOs with the same resv object during object creation.
> Do you have a preference of how to address this? One idea would be to
> forward the operation ctx to the eviction_valuable callback. Another to
> add an "unbound" flag to the bo and an "unbound_only" flag to the
> operation ctx.
Adding the ctx to the eviction valuable callback sounds like a good approach to me.
Regards,
Christian.
>
> Any feedback appreciated.
> Thanks,
> Thomas
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-16 11:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13 9:14 TTM evicting same-vm bos Hellstrom, Thomas
2025-05-16 11:12 ` Christian König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).