[PATCH 00/13] shadow page table support

zhoucm1 david1.zhou at amd.com
Tue Jul 26 08:41:57 UTC 2016

On 2016年07月26日 16:27, Christian König wrote:
> Am 26.07.2016 um 07:33 schrieb zhoucm1:
>> On 2016年07月26日 10:40, zhoucm1 wrote:
>>> 1. We add an optional "shadow" flag so that when a BO in VRAM is 
>>> allocated we also allocate a shadow BO in GART.
>>> 2. We have another "backup" flag that says on the next command 
>>> submission the BO is backed up from VRAM to GART before that 
>>> submission.
>>> 3. We set the shadow flag for VM PD/PT BOs and every time we modify 
>>> them set the backup flag so they get backed up on next CS.
>>> 4. We add an IOCTL to allow setting the backup flag from userspace 
>>> so that we can trigger another backup even after the first CS. 
>> When I'm trying it and thinking more, a general shadow BO indeed be a 
>> sense way, but backup flag seems not necessary, mainly two reasons:
>> 1. we cannot make sure backup job is completed when gpu reset happens.
> Correct, but we can't guarantee that for VM updates either.
Since we directly fill pte info to shadow BO, not copy from VRAM to GTT. 
Which ensures shadow BO content always is right, event these jobs don't 
complete when gpu reset, but after gpu reset, we can sync these jobs, 
and then copy GTT to VRAM. The similar case is also same for shader BOs. 
So we should directly fill the shadow BOs.

David Zhou
>> 2. backup flag is to copy the whole BO, which seems overhead. If we 
>> update shadow BO along with BO in real time, e.g. PD/PT, we could 
>> only update some ptes not the entire BO.
> How about using a begin/end range of which parts of the BO needs to be 
> backed up instead of a flag?
>> So can we assume shadow BO always needed to backup if shadow flag is 
>> set?
> For shader BOs clearly not a good idea because they are rarely update 
> and so backing them up every time would be a huge overhead.
> Regards,
> Christian.
>> Regards,
>> David Zhou

More information about the amd-gfx mailing list