From ab17b49e15a6f293b2f9113aea3806d04df0bc55 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 19 Jan 2018 14:32:15 +0300 Subject: [PATCH] scheduler stuff - more threads for rsx - better 1600 --- Utilities/Thread.cpp | 19 ++++++++++++++----- rpcs3/Emu/Cell/SPUThread.cpp | 4 +++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index cce866eecf..fceb85f6e9 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1890,18 +1890,25 @@ u16 thread_ctrl::get_affinity_mask(thread_class group) } case native_core_arrangement::amd_ccx: { - u16 primary_ccx_unit_mask; + u16 spu_mask, ppu_mask, rsx_mask; if (thread_count >= 16) { // Threadripper, R7 // Assign threads 8-16 // It appears some windows code is bound to lower core addresses, binding 8-16 is alot faster than 0-7 - primary_ccx_unit_mask = 0b1111111100000000; + ppu_mask = spu_mask = 0b1111111100000000; + rsx_mask = all_cores_mask; + } + else if (thread_count == 12) + { + // 1600/2600 (x) + ppu_mask = spu_mask = 0b111111000000; + rsx_mask = all_cores_mask; } else { - // R5 & R3 don't seem to improve performance no matter how these are shuffled (including 1600) - primary_ccx_unit_mask = 0b11111111 & all_cores_mask; + // R5 & R3 don't seem to improve performance no matter how these are shuffled + ppu_mask = spu_mask = rsx_mask = 0b11111111 & all_cores_mask; } switch (group) @@ -1910,9 +1917,11 @@ u16 thread_ctrl::get_affinity_mask(thread_class group) case thread_class::general: return all_cores_mask; case thread_class::rsx: + return rsx_mask; case thread_class::ppu: + return ppu_mask; case thread_class::spu: - return primary_ccx_unit_mask; + return spu_mask; } } case native_core_arrangement::intel_ht: diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index 483ddbd30f..eb98662899 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -142,8 +142,10 @@ namespace spu { if (remaining >= native_jiffy_duration_us) std::this_thread::sleep_for(1ms); + else if (remaining > 100) + std::this_thread::yield(); else - busy_wait(remaining); + busy_wait(); const auto now = get_system_time(); const auto elapsed = now - start;