rsx: Avoid acquiring the vm lock; deadlock evasion

- A possible deadlock is still present if rsx is trying to get a super_ptr whilst the vm lock holder is in an access violation
  This patch makes this scenario very unlikely since each block need only be touched once
This commit is contained in:
kd-11 2018-07-27 00:03:55 +03:00 committed by kd-11
parent 741ee9ac41
commit 38191c3013
6 changed files with 52 additions and 16 deletions

View file

@ -1373,6 +1373,24 @@ namespace rsx
for (const auto& range : m_invalidated_memory_ranges)
{
on_invalidate_memory_range(range.first, range.second);
// Clean the main memory super_ptr cache if invalidated
const auto range_end = range.first + range.second;
for (auto It = main_super_memory_block.begin(); It != main_super_memory_block.end();)
{
const auto mem_start = It->first;
const auto mem_end = mem_start + It->second.size();
const bool overlaps = (mem_start < range_end && range.first < mem_end);
if (overlaps)
{
It = main_super_memory_block.erase(It);
}
else
{
It++;
}
}
}
m_invalidated_memory_ranges.clear();