fix: prevent schedutil deadlock on Samsung Snapdragon devices#133
fix: prevent schedutil deadlock on Samsung Snapdragon devices#133dyokism wants to merge 2 commits into
Conversation
- Add a device rule in device_mitigation.json to blacklist the schedutil governor on Samsung Snapdragon devices. - Update EncoreConfigStore.cpp to silently fall back to the walt governor if schedutil is requested by the user. - Add a native shell check to service.sh to ensure the schedutil governor is bypassed during early boot before the daemon starts.
|
After reviewing your PR, I see that you blindly applying Please note that This make me question:
Or even better question, do you understand how the "math problem" actually happens when Snapdragon device are using |
- Check available governors in sysfs before replacing schedutil - Ensures compatibility on older pre-GKI kernels
a9ea58c to
cb68003
Compare
|
Hi! Thanks for the review. Here is the "math problem" on modern GKI devices:
To fix this, I updqted the script and daemon. They now check if walt exists in /cpufreq/scaling_available_governors before applying the bypass. If walt is missing, we leave schedutil alone. And, on older devices, the schedutil governor was modified by Qualcomm directly to support WALT, so it is safe and does not deadlock. LMK if you need any changes |
Fixes #114
This PR fixes a critical bug where the
schedutilCPU governor causes an infinite loop and 100% CPU usage on Samsung Snapdragon devices.Bug
When we force the
schedutilgovernor on modern Samsung Snapdragon devices, it creates a math problem. The generic Linux system uses PELT (smooth averages) to read CPU load, but Samsung hardware uses WALT (instant spikes). Because of this mismatch,schedutilgets confused and asks the hardware for maximum speed all the time. The hardware thermal limits (LMh) reject this request to stop overheating. However,schedutildoesn't know how to wait, so it retries the request millions of times per second. This endless loop completely freezes the Prime Core at 100% usage.Solution
I created a global safety rule for Samsung Snapdragon devices. Now, the app and shell scripts will automatically block any requests for the
schedutilgovernor on these specific devices. Instead, it will safely switch to thewaltgovernor, which prevents the lockup completely.