<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Was userspace maybe performing concurrent CPU access to the BOs in question?</blockquote><div><br></div><div>As far as I know Julien has demonstrated that this is not the case. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I hope we can find a better solution.</blockquote><div><br></div><div><div>Understood -- I thought you might not want to take this patch, but I went ahead and sent it out because Christian requested it, and it seems like he doesn't think VRAM bos should ever evict back to VRAM at all?</div><div><br></div><div>Is my understanding of the original commit correct in that it tries to rewrite the eviction placements of CPU accessible bos so that they are either size zero (fpfn and lpfn = start of inaccessible VRAM) or they are in inaccessible VRAM (fpfn = start of inaccessible VRAM and lpfn = 0)?</div><div><br></div><div>In this case, to me it seems that the simplest fix would be to iterate using i to rewrite all the VRAM placements instead of just the first one (rbo->placements[i] instead of rbo->placements[0]). In the case where <span style="font-size:12.8px">RADEON_GEM_NO_CPU_ACCESS is set, the second placement will be in CPU accessible VRAM, and that doesn't seem correct to me as there is no longer any sort of ordering for evictions.</span> (Unfortunately I'm not currently in a position to test whether this fixes our issue.) Sorry, I meant to make a note of this originally.</div><div><br></div><div>Also, I don't claim to understand this code well enough, but I wonder: if these sorts of evictions are desirable, would it make more sense to treat CPU inaccessible/accessible VRAM as distinct entities with their own lrus?</div><div><br></div><div>I should also note that we are experiencing another issue where the kernel locks up in similar circumstances. As Julien noted, we get no output, and the watchdogs don't seem to work. It may be the case that Xorg and our process are calling ttm_bo_mem_force_space concurrently, but I don't think we have enough information yet to say for sure. Reverting this commit does not fix that issue. I have some small amount of evidence indicating that bos flagged for CPU access are getting placed in CPU inaccessible memory. Could that cause this sort of kernel lockup?</div></div><div><br></div><div>Thanks for your help.</div></div></div></div>