Am 10.06.20 um 15:54 schrieb Andrey
Grodzovsky:
On 6/10/20 6:15 AM, Thomas Hellström
(Intel) wrote:
On 6/9/20 7:21 PM, Koenig,
Christian wrote:
I think so, yes.
Christian.
Yes, that's true. However, without the bo reservation,
nothing stops a PTE from being immediately re-faulted back
again. Even while unmap_mapping_range() is running.
Can you explain more on this - specifically, which function to
reserve the BO, why BO reservation would prevent re-fault of the
PTE ?
Thomas is talking about ttm_bo_reserver()/ttm_bo_unreserve(), but we
don't need this because we unmap everything because the whole device
is gone and not just manipulate a single BO.
So the device removed flag needs to be advertized before this
function is run,
I indeed intend to call this right after calling
drm_dev_unplug from amdgpu_pci_remove while adding
drm_dev_enter/exit in ttm_bo_vm_fault (or in amdgpu specific
wrapper since I don't see how can I access struct drm_device
from ttm_bo_vm_fault) and this in my understanding should stop a
PTE from being re-faulted back as you pointed out - so again I
don't see how bo reservation would prevent it so it looks like
I am missing something...
(perhaps with a memory barrier pair).
drm_dev_unplug and drm_dev_enter/exit are RCU synchronized and
so I don't think require any extra memory barriers for
visibility of the removed flag being set
As far as I can see that should be perfectly sufficient.
Christian.
Andrey
That should probably be added to the function documentation.
(Other than that, please add a commit message if respinning).
/Thomas
|
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel