mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 03:08:36 +12:00
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:
parent
741ee9ac41
commit
38191c3013
6 changed files with 52 additions and 16 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue