Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] Implement svm without BO concept in xe driver
@ 2023-08-15  3:37 Zeng, Oak
  2023-08-15 20:34 ` Zeng, Oak
  0 siblings, 1 reply; 20+ messages in thread
From: Zeng, Oak @ 2023-08-15  3:37 UTC (permalink / raw)
  To: Thomas Hellström, Brost, Matthew, Vishwanathapura, Niranjana,
	Welty, Brian, Felix Kuehling, Philip Yang,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org

[-- Attachment #1: Type: text/plain, Size: 1986 bytes --]

Hi Thomas, Matt and all,

This came up when I port i915 svm codes to xe driver. In i915 implementation, we have i915_buddy manage gpu vram and svm codes directly call i915_buddy layer to allocate/free vram. There is no gem_bo/ttm bo concept involved in the svm implementation.

In xe driver,  we have drm_buddy, xe_ttm_vram_mgr and ttm layer to manage vram. Drm_buddy is initialized during xe_ttm_vram_mgr initialization. Vram allocation/free is done through xe_ttm_vram_mgr functions which call into drm_buddy layer to allocate vram blocks.

I plan to implement xe svm driver the same way as we did in i915, which means there will not be bo concept in the svm implementation. Drm_buddy will be passed to svm layer during vram initialization and svm will allocate/free memory directly from drm_buddy, bypassing ttm/xee vram manager. Here are a few considerations/things we are aware of:


  1.  This approach seems match hmm design better than bo concept. Our svm implementation will be based on hmm. In hmm design, each vram page is backed by a struct page. It is very easy to perform page granularity migrations (b/t vram and system memory). If BO concept is involved, we will have to split/remerge BOs during page granularity migrations.



  1.  We have a prove of concept of this approach in i915, originally implemented by Niranjana. It seems work but it only has basic functionalities for now.



  1.  With this approach, vram will divided into two separate pools: one for xe_gem_created BOs and one for vram used by svm. Those two pools are not connected: memory pressure from one pool won't be able to evict vram from another pool. At this point, we don't whether this aspect is good or not.



  1.  Amdkfd svm went different approach which is BO based. The benefit of this approach is a lot of existing driver facilities can be reused.



Do you have any comment to this approach? Should I come back with a RFC of some POC codes?

Thanks,
Oak


[-- Attachment #2: Type: text/html, Size: 6539 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-08-22 17:50 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15  3:37 [Intel-xe] Implement svm without BO concept in xe driver Zeng, Oak
2023-08-15 20:34 ` Zeng, Oak
2023-08-15 22:17   ` Felix Kuehling
2023-08-16  3:47     ` Zeng, Oak
2023-08-16  6:05       ` Christian König
2023-08-16 17:30         ` Zeng, Oak
2023-08-16 21:55           ` Felix Kuehling
2023-08-16 22:51             ` Dave Airlie
2023-08-17  2:12               ` Zeng, Oak
2023-08-18  7:36                 ` Thomas Hellström
2023-08-18 16:10                   ` Zeng, Oak
2023-08-18 16:54                     ` Felix Kuehling
2023-08-20 22:21                 ` Dave Airlie
2023-08-21 15:06                   ` Zeng, Oak
2023-08-21 15:10                     ` Zeng, Oak
2023-08-21 19:17                       ` Felix Kuehling
2023-08-21 19:41                         ` Zeng, Oak
2023-08-21 20:57                           ` Felix Kuehling
2023-08-22 11:43                             ` Ruhl, Michael J
2023-08-22 17:50                               ` Zeng, Oak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox