diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index 13e2ea78c3..5ab587c1a6 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -1956,6 +1956,12 @@ bool spu_thread::process_mfc_cmd() const u32 addr = ch_mfc_cmd.eal & -128; const auto& data = vm::_ref(addr); + if (addr == raddr && !g_use_rtm && g_cfg.core.spu_getllar_polling_detection && rtime == vm::reservation_acquire(addr, 128) && cmp_rdata(rdata, data)) + { + // Spinning, might as well yield cpu resources + std::this_thread::yield(); + } + auto& dst = _ref(ch_mfc_cmd.lsa & 0x3ff80); u64 ntime; diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index fe07b56da7..53a9af906c 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -35,10 +35,11 @@ struct cfg_root : cfg::node cfg::_bool set_daz_and_ftz{ this, "Set DAZ and FTZ", false }; cfg::_enum spu_decoder{ this, "SPU Decoder", spu_decoder_type::llvm }; cfg::_bool lower_spu_priority{ this, "Lower SPU thread priority" }; + cfg::_bool spu_getllar_polling_detection{ this, "SPU GETLLAR polling detection", false, true }; cfg::_bool spu_debug{ this, "SPU Debug" }; cfg::_int<0, 6> preferred_spu_threads{ this, "Preferred SPU Threads", 0, true }; // Number of hardware threads dedicated to heavy simultaneous spu tasks cfg::_int<0, 16> spu_delay_penalty{ this, "SPU delay penalty", 3 }; // Number of milliseconds to block a thread if a virtual 'core' isn't free - cfg::_bool spu_loop_detection{ this, "SPU loop detection", true }; // Try to detect wait loops and trigger thread yield + cfg::_bool spu_loop_detection{ this, "SPU loop detection", true, true }; // Try to detect wait loops and trigger thread yield cfg::_int<0, 6> max_spurs_threads{ this, "Max SPURS Threads", 6 }; // HACK. If less then 6, max number of running SPURS threads in each thread group. cfg::_enum spu_block_size{ this, "SPU Block Size", spu_block_size_type::safe }; cfg::_bool spu_accurate_getllar{ this, "Accurate GETLLAR", false };