CPU: improve cpu_thread::suspend_all for cache efficiency (TSX)

Add prefetch hint list parameter.
Workloads may be executed by another thread on another CPU core.
It means they may benefit from directly prefetching the data as hinted.
Also implement mov_rdata_nt, for "streaming" data from such workloads.
This commit is contained in:
Nekotekina 2020-10-30 05:17:00 +03:00
parent e794109a67
commit 0da24f21d6
6 changed files with 132 additions and 32 deletions

View file

@ -543,16 +543,18 @@ namespace vm
void reservation_op_internal(u32 addr, std::function<bool()> func)
{
cpu_thread::suspend_all(get_current_cpu_thread(), [&]
auto& res = vm::reservation_acquire(addr, 128);
cpu_thread::suspend_all(get_current_cpu_thread(), {&res}, [&]
{
if (func())
{
// Success, release all locks if necessary
vm::reservation_acquire(addr, 128) += 127;
res += 127;
}
else
{
vm::reservation_acquire(addr, 128) -= 1;
res -= 1;
}
});
}