<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On May 16, 2017 3:57 AM, "Michel Dänzer" <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On 15/05/17 07:11 PM, Marek Olšák wrote:<br>
> On May 15, 2017 4:29 AM, "Michel Dänzer" <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a><br>
</div><div class="quoted-text">> <mailto:<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>>> wrote:<br>
><br>
> I think the next step should be to make radeonsi keep track of how much<br>
> VRAM it's trying to use that's expected to be accessed by the CPU, and<br>
> to use GTT instead when that exceeds a threshold (probably derived from<br>
> vram_vis_size).<br>
><br>
> That's difficult to estimate. There are apps with 600MB of mapped VRAM<br>
> and don't experience any performance issues. And some apps with 300MB of<br>
> mapped VRAM do. It only depends on the CPU access pattern, not what<br>
> radeonsi sees.<br>
<br>
</div>What I mean is keeping track of the total size of resources which have<br>
RADEON_DOMAIN_VRAM and RADEON_FLAG_CPU_ACCESS set, and if it exceeds a<br>
threshold, create new ones having those flags in GTT instead. Even<br>
though this might not be strictly necessary with amdgpu in the long run,<br>
it probably is for radeon anyway, and in the short term it might help<br>
even with amdgpu.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">That might hurt us more than it can help. All mappable buffers have the CPU access flag set, but many of them are immutable.</div><div dir="auto"><br></div><div dir="auto">The only place where this can be handled is the kernel. Even if it's as simple as: if (bo->numcpufaults > 10) domain = GTT_WC;</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="elided-text"><br>
<br>
--<br>
Earthling Michel Dänzer | <a href="http://www.amd.com" rel="noreferrer" target="_blank">http://www.amd.com</a><br>
Libre software enthusiast | Mesa and X developer<br>
</div></blockquote></div><br></div></div></div>