mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 21:32:50 +00:00
Optimization: disable atomic_wait_engine notify callback for SPU
Disable placebo callback calls in notify_all. Don't use callback at all if TSX. Based on kd-11 findings.
This commit is contained in:
parent
fb27ed4deb
commit
6d3052c5dd
@ -446,7 +446,7 @@ void cpu_thread::operator()()
|
||||
// Register thread in g_cpu_array
|
||||
s_cpu_counter++;
|
||||
|
||||
atomic_wait_engine::set_notify_callback([](const void*, u64 progress)
|
||||
atomic_wait_engine::set_notify_callback(g_use_rtm || id_type() != 1 /* PPU */ ? nullptr : +[](const void*, u64 progress)
|
||||
{
|
||||
static thread_local bool wait_set = false;
|
||||
|
||||
|
@ -1310,14 +1310,10 @@ void atomic_wait_engine::notify_one(const void* data, u32 size, u128 mask)
|
||||
if (s_tls_notify_cb)
|
||||
s_tls_notify_cb(data, 0);
|
||||
|
||||
u64 progress = 0;
|
||||
|
||||
root_info::slot_search(iptr, mask, [&](u32 cond_id)
|
||||
{
|
||||
if (alert_sema(cond_id, size, mask))
|
||||
{
|
||||
if (s_tls_notify_cb)
|
||||
s_tls_notify_cb(data, ++progress);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1335,8 +1331,6 @@ SAFE_BUFFERS(void) atomic_wait_engine::notify_all(const void* data, u32 size, u1
|
||||
if (s_tls_notify_cb)
|
||||
s_tls_notify_cb(data, 0);
|
||||
|
||||
u64 progress = 0;
|
||||
|
||||
// Array count for batch notification
|
||||
u32 count = 0;
|
||||
|
||||
@ -1378,8 +1372,6 @@ SAFE_BUFFERS(void) atomic_wait_engine::notify_all(const void* data, u32 size, u1
|
||||
{
|
||||
if (s_cond_list[cond_id].try_alert_native())
|
||||
{
|
||||
if (s_tls_notify_cb)
|
||||
s_tls_notify_cb(data, ++progress);
|
||||
*(std::end(cond_ids) - i - 1) = ~cond_id;
|
||||
}
|
||||
}
|
||||
@ -1394,8 +1386,6 @@ SAFE_BUFFERS(void) atomic_wait_engine::notify_all(const void* data, u32 size, u1
|
||||
if (cond_id <= u16{umax})
|
||||
{
|
||||
s_cond_list[cond_id].alert_native();
|
||||
if (s_tls_notify_cb)
|
||||
s_tls_notify_cb(data, ++progress);
|
||||
*(std::end(cond_ids) - i - 1) = ~cond_id;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user