From 103b2fe5fd29ef37c7f5f736e1a24b43a9b19111 Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Fri, 12 Apr 2024 08:40:40 +0300 Subject: [PATCH] PPU/reservations: send thread notification only if data changed --- rpcs3/Emu/Cell/PPUThread.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index a7dacbe171..8c10b59928 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -3481,17 +3481,17 @@ static bool ppu_store_reservation(ppu_thread& ppu, u32 addr, u64 reg_value) { extern atomic_t liblv2_begin, liblv2_end; - const u32 notify = ppu.res_notify; - - if (notify) - { - vm::reservation_notifier(notify).notify_all(); - ppu.res_notify = 0; - } - // Avoid notifications from lwmutex or sys_spinlock - if (ppu.cia < liblv2_begin || ppu.cia >= liblv2_end) + if (new_data != old_data && (ppu.cia < liblv2_begin || ppu.cia >= liblv2_end)) { + const u32 notify = ppu.res_notify; + + if (notify) + { + vm::reservation_notifier(notify).notify_all(); + ppu.res_notify = 0; + } + if (!notify) { // Try to postpone notification to when PPU is asleep or join notifications on the same address