<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div>Hi Matthew,</div>
<div><br>
</div>
<div>this doesn't work, I've already tried something similar.</div>
<div><br>
</div>
<div>TTM uses the reverse lookup functionality when migrating BOs between system and device memory. And that doesn't seem to work with pages from a shmem file.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Christian.</div>
<div><br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Matthew Auld <matthew.william.auld@gmail.com><br>
<b>Gesendet:</b> Donnerstag, 9. September 2021 16:56<br>
<b>An:</b> Christian König <ckoenig.leichtzumerken@gmail.com>; Koenig, Christian <Christian.Koenig@amd.com><br>
<b>Cc:</b> Thomas Hellström <thomas.hellstrom@linux.intel.com>; ML dri-devel <dri-devel@lists.freedesktop.org><br>
<b>Betreff:</b> i915 ttm_tt shmem backend</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Christian,<br>
<br>
We are looking into using shmem as a ttm_tt backend in i915 for cached<br>
system memory objects. We would also like to make such objects visible<br>
to the i915-gem shrinker, so that they may be swapped out or discarded<br>
when under memory pressure.<br>
<br>
One idea for handling this is roughly something like:<br>
- Add a new TTM_PAGE_FLAG_SHMEM flag, or similar.<br>
- Skip the ttm_pages_allocated accounting on such objects, similar to<br>
how FLAG_SG is already handled.<br>
- Skip all the page->mapping and page->index related bits, like in<br>
tt_add_mapping, since it looks like these are set and used by shmem.<br>
Not sure what functionally this might break, but looks like it's maybe<br>
only driver specific?<br>
- Skip calling into ttm_bo_swap_out/in and just have<br>
ttm_populate/unpopulate handle this directly for such objects.<br>
- Make such objects visible to the i915-gem shrinker.<br>
<br>
Does this approach look acceptable?<br>
</div>
</span></font></div>
</body>
</html>