rpcsx/rpcs3/Emu/Cell/lv2
Eladash f2997e4c00 LV2: Fix the most annoying race ever
Timeline of the race:
1. The PPU is in SLEEP state. state = suspend.
2. lv2_obj::awake is called on the traced thread and is now in ONPROC state, state = signal.
3. lv2_obj::awake is called by another thread externally with a priority higher than our traced thread and appends it to g_pending. state = suspend + signal.
4. lv2_obj::sleep/set_priority (higering priority) is called on any thread which is in ONPROC. Causing it to enter SLEEP or RUNNING state, while the traced thread is back in queue in ONPROC. state = suspend + signal.
5. The traced thread finally calls lv2_obj::awake on itself, g_pending decrements to 0 and we a have a rescheduling event, after XOR state = 0!!! (no signal)
6. In check_state: cpu_sleep_called is now true and remains this way.
7. Another thread with a higher prioty kicks in and appends the traced thread into g_pending. state = suspend.
8. The traced thread is at cpu_thread::cpu_wait(), and that's where it's gonna spend the rest of its life.
2022-08-11 12:44:40 +03:00
..
sys_net sys_net: Implement sys_net_abort 2022-07-17 14:53:03 +03:00
lv2.cpp LV2: Fix the most annoying race ever 2022-08-11 12:44:40 +03:00
sys_bdemu.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
sys_bdemu.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_btsetting.cpp VSH: Stubs 2020-02-08 23:07:03 +03:00
sys_btsetting.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_cond.cpp sys_cond/lwcond: Fix waiting time in the debugger for mutex lock 2022-08-11 11:42:16 +03:00
sys_cond.h LV2: Make sys_mutex and sys_lwmutex lock-free, add some busy waiting in sys_mutex_lock 2022-08-07 20:23:54 +03:00
sys_config.cpp IdManager.h: Improvements 2022-06-22 17:24:47 +03:00
sys_config.h Remove incorrect Emu.IsStopped() checks 2022-07-05 08:25:36 +02:00
sys_console.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
sys_console.h VSH: Stubs 2020-02-08 23:07:03 +03:00
sys_crypto_engine.cpp VSH: Stubs 2020-02-08 23:07:03 +03:00
sys_crypto_engine.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_dbg.cpp Fix vm::range_lock, imporve vm::check_addr 2020-11-11 10:30:09 +03:00
sys_dbg.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_event.cpp LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
sys_event.h LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
sys_event_flag.cpp LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
sys_event_flag.h LV2: Make sys_mutex and sys_lwmutex lock-free, add some busy waiting in sys_mutex_lock 2022-08-07 20:23:54 +03:00
sys_fs.cpp Prefer BDVD over HDD0 in vfs::retrieve 2022-07-19 10:43:51 +03:00
sys_fs.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_gamepad.cpp More random changes 2021-04-11 14:01:51 +03:00
sys_gamepad.h Replace uint8_t with u8 2020-12-18 12:23:53 +03:00
sys_gpio.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
sys_gpio.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_hid.cpp Fix some warnings 2021-07-30 09:31:36 +03:00
sys_hid.h sys_hid vsh 2021-07-18 14:20:33 +02:00
sys_interrupt.cpp Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_interrupt.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_io.cpp Stub sys_io for vsh. 2021-07-17 17:06:57 +02:00
sys_io.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_lwcond.cpp Savestates/LV2: Fix race on _sys_lwcond_queue_wait saving 2022-08-11 11:42:16 +03:00
sys_lwcond.h LV2: Make sys_mutex and sys_lwmutex lock-free, add some busy waiting in sys_mutex_lock 2022-08-07 20:23:54 +03:00
sys_lwmutex.cpp LV2: Optimizations and fixes 2022-08-11 11:42:16 +03:00
sys_lwmutex.h sys_mutex/lwmutex: Regression fixes after #12378 2022-08-11 11:42:16 +03:00
sys_memory.cpp Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_memory.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_mmapper.cpp Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_mmapper.h Savestates: Add missing position placement 2022-07-05 08:25:36 +02:00
sys_mutex.cpp LV2: Optimizations and fixes 2022-08-11 11:42:16 +03:00
sys_mutex.h sys_mutex/lwmutex: Regression fixes after #12378 2022-08-11 11:42:16 +03:00
sys_net.cpp LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
sys_net.h sys_net: Implement sys_net_abort 2022-07-17 14:53:03 +03:00
sys_overlay.cpp Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_overlay.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_ppu_thread.cpp LV2: Optimize sys_ppu_thread a bit 2022-08-11 11:42:16 +03:00
sys_ppu_thread.h kernel-explorer: Implement PPU scheduler state information 2021-05-21 18:12:36 +02:00
sys_process.cpp Perform cleanup after Emulator::Load failures 2022-07-19 10:43:51 +03:00
sys_process.h sys_rsxaudio: Add id to kernel explorer and some fixes 2022-05-23 13:10:46 +02:00
sys_prx.cpp Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_prx.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_rsx.cpp RSX/Savestates: Replace GCM hack with a proper fix 2022-07-08 12:57:43 +03:00
sys_rsx.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_rsxaudio.cpp Audio: device switching and channel count detection (#12246) 2022-07-08 17:13:38 +02:00
sys_rsxaudio.h Audio: device switching and channel count detection (#12246) 2022-07-08 17:13:38 +02:00
sys_rwlock.cpp LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
sys_rwlock.h LV2: Make sys_mutex and sys_lwmutex lock-free, add some busy waiting in sys_mutex_lock 2022-08-07 20:23:54 +03:00
sys_semaphore.cpp LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
sys_semaphore.h LV2: Make sys_mutex and sys_lwmutex lock-free, add some busy waiting in sys_mutex_lock 2022-08-07 20:23:54 +03:00
sys_sm.cpp sys_sm_get_ext_event2 stub 2021-07-17 18:35:26 +02:00
sys_sm.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_spu.cpp LV2: Move nearly all notifications out of all mutex scopes including IDM 2022-08-07 20:23:54 +03:00
sys_spu.h Savestates/sys_spu: Minor fix in saving sys_spu_thread_receive_event 2022-07-10 14:19:59 +03:00
sys_ss.cpp Fix some warnings 2021-07-30 09:31:36 +03:00
sys_ss.h More random changes 2021-04-11 14:01:51 +03:00
sys_storage.cpp Fix sys_storage_read 2021-07-30 17:22:43 +03:00
sys_storage.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_sync.h LV2: Optimizations and fixes 2022-08-11 11:42:16 +03:00
sys_time.cpp Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_time.h Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
sys_timer.cpp LV2: Optimizations and fixes 2022-08-11 11:42:16 +03:00
sys_timer.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_trace.cpp Remove BOM markers 2020-12-06 15:30:12 +03:00
sys_trace.h Move types.h to util/types.hpp 2020-12-12 15:12:01 +03:00
sys_tty.cpp Warning Fixes 2022-03-23 19:35:10 +01:00
sys_tty.h Add debugging info for when sys_tty_write is executed 2021-09-12 19:05:26 +03:00
sys_uart.cpp sys_rsxaudio: Add id to kernel explorer and some fixes 2022-05-23 13:10:46 +02:00
sys_uart.h More sys_uart packets (#11332) 2022-01-10 03:43:54 +03:00
sys_usbd.cpp LV2: Make sys_mutex and sys_lwmutex lock-free, add some busy waiting in sys_mutex_lock 2022-08-07 20:23:54 +03:00
sys_usbd.h Impl sys_usbd_get_device_location 2021-11-25 00:53:00 +01:00
sys_vm.cpp Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
sys_vm.h Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00