<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
Yes, Andrey is right.<br>
<br>
A top level explanation is that we don't prevent moving the buffer
but rather we prevent user space from accessing it.<br>
<br>
Regards,<br>
Christian.<br>
<br>
<div class="moz-cite-prefix">Am 05.04.21 um 18:34 schrieb Andrey
Grodzovsky:<br>
</div>
<blockquote type="cite"
cite="mid:729f8458-4586-2fd8-6232-012907c47ccc@amd.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<p>From my understanding and looking at the code I think we don't
prevent but rather invalidate current user mappings and use
subsequent page faults to map into user space process the pages
from the new location. Check what this function is doing during
move -
<a class="moz-txt-link-freetext"
href="https://elixir.bootlin.com/linux/v5.12-rc5/source/drivers/gpu/drm/ttm/ttm_bo.c#L238"
moz-do-not-send="true">https://elixir.bootlin.com/linux/v5.12-rc5/source/drivers/gpu/drm/ttm/ttm_bo.c#L238</a><br>
</p>
<p>Andrey<br>
</p>
<div class="moz-cite-prefix">On 2021-04-05 12:01 p.m., 258454946
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:tencent_826EEA87BF2072281A8B94B2955DDCA14E05@qq.com">
<div>Hi Guys,</div>
<div><br>
</div>
<div>I am a newbee of gfx development. Recently, I am
researching amdgpu open source driver, and encounter a
problem, but do not find the answer.</div>
<div><br>
</div>
<div>We know the user maybe map a gem backing buffer for
reading/writing and hold the mapping for a long term. while,
kernel driver will also moves the user mapped bo to other
memory region. vram ->gtt, gtt->vram, even it may be
swaped out under OOM case.</div>
<div><br>
</div>
<div>So, my question is how driver prevents kernel ttm from
moving the user mapped bo while user is accessing it?</div>
<div><br>
</div>
<div>Thanks for your attention!</div>
<div><br>
</div>
<div>Lizhi.</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
amd-gfx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a>
</pre>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
amd-gfx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a>
</pre>
</blockquote>
<br>
</body>
</html>