hamadmarri / TT-CPU-Scheduler

Task Type (TT) is an alternative CPU Scheduler for linux.
107 stars 12 forks source link

Severe performance issues with Back 4 Blood. #20

Open LethalManBoob opened 1 year ago

LethalManBoob commented 1 year ago

Ill give details as needed but i dont know what to include here other than my experience. Basicly B4B lags VERRRY badly with this scheduler. Its mostly unplayable. This is not an issue with the regular xanmod or any other scheduler except bmq in my experience.

ptr1337 commented 1 year ago

Could you maybe provide more information? Which Kernel version you are running? Which load balancer from TT ? Which custom kernel .. ?

LethalManBoob commented 1 year ago

Any kernel that features the TT kernel has this exact issue with no variation. I run 5.19 but this has been going on for a long time. afaik I am not aware of what you mean by load balancer. Just tt from what i know of. But i have tried xanmod-tt and cachyos's linux-tt

ptr1337 commented 1 year ago

You can set different load balancers. Check the README from this repo: https://github.com/hamadmarri/TT-CPU-Scheduler#sysctls

May try it with the CB or GRQ and report it back.

hamadmarri commented 1 year ago

The output of lscpu Please

LethalManBoob commented 1 year ago

The output of lscpu Please

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: AuthenticAMD Model name: AMD Ryzen 7 5800X 8-Core Processor CPU family: 25 Model: 33 Thread(s) per core: 2 Core(s) per socket: 8 Socket(s): 1 Stepping: 0 Frequency boost: enabled CPU(s) scaling MHz: 72% CPU max MHz: 4850.1948 CPU min MHz: 2200.0000 BogoMIPS: 7599.93 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clf lush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm cons tant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pc lmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalig nsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb sti bp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx s map clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup _llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd ar at npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassis ts pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku o spke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm Virtualization features: Virtualization: AMD-V Caches (sum of all):
L1d: 256 KiB (8 instances) L1i: 256 KiB (8 instances) L2: 4 MiB (8 instances) L3: 32 MiB (1 instance) NUMA:
NUMA node(s): 1 NUMA node0 CPU(s): 0-15 Vulnerabilities:
Itlb multihit: Not affected L1tf: Not affected Mds: Not affected Meltdown: Not affected Mmio stale data: Not affected Retbleed: Not affected Spec store bypass: Vulnerable Spectre v1: Vulnerable: __user pointer sanitization and usercopy barriers only; no swap gs barriers Spectre v2: Vulnerable, IBPB: disabled, STIBP: disabled, PBRSB-eIBRS: Not affected Srbds: Not affected Tsx async abort: Not affected

LethalManBoob commented 1 year ago

You can set different load balancers. Check the README from this repo: https://github.com/hamadmarri/TT-CPU-Scheduler#sysctls

May try it with the CB or GRQ and report it back.

remember im only testing with b4b which is veryyy sensitive to cpu schedulers and the like. It is also the only game i have seen that excibits this extreme stutter with certain cpu schedulers. power govornors change nothing The stutter goes like this cfs > pds > bore > TT > anything else just locks the pc

0: Normal TT balancer = good fps / unplayable stutter 1: Candidate Balancer (which is an addition to normal TT balancer) = performed same as above 2: Global runqueue GRQ = very bad fps / bad stutter but didnt stutter as bad later on ( still terrible ) 3: Power save balancer = very bad fps / second long system hitches every couple seconds / basicly unsuable

hamadmarri commented 1 year ago

It is a balancer issue. Wait for the next LTS. I am going to add the cfs balancer back as an option.

LethalManBoob commented 1 year ago

Just so we are clear. I am using cachyos's TT kernel. But xanmod is the exact same.

hamadmarri commented 1 year ago

@LethalManBoob

Could you try this patch with cfs balancer https://github.com/hamadmarri/TT-CPU-Scheduler/blob/master/patches/6.0/tt-6.0.patch

option 2 (replaced GRQ with CFS)

raykzhao commented 1 year ago

Hi @hamadmarri,

Good to hear that you are still maintaining the tt scheduler. I'm compiling the kernels with the latest tt scheduler on my devices (on top of the 5.19 kernel with backported 6.0 scheduler patches from the clearlinux github repo)

Just one small thing: it might be a good idea to add a knob to enable/disable the latency sensitive feature. I remember this was not battery friendly on my laptop. Although I saw there is kernel.sched_tt_balancer_opt = 3, which would enable those energy efficient features, one may not want find_energy_efficient_cpu (removed in xanmod). In addition, there is a recent revived effort of the original latency nice patch, which seems to work differently compared to the current approach in tt.

ptr1337 commented 1 year ago

Besides from TT: @raykzhao

Actually, @vnepogodin has implemented a first test for latency nice into ananicy-cpp. It does right now a conversion from rules which are set with sched_nice to sched_latency_nice. Its currently a WIP and for testing. Works so far.

You can find it here: https://gitlab.com/ananicy-cpp/ananicy-cpp/-/tree/feature/latency-nice

hamadmarri commented 1 year ago

Hi @hamadmarri,

Good to hear that you are still maintaining the tt scheduler. I'm compiling the kernels with the latest tt scheduler on my devices (on top of the 5.19 kernel with backported 6.0 scheduler patches from the clearlinux github repo)

Just one small thing: it might be a good idea to add a knob to enable/disable the latency sensitive feature. I remember this was not battery friendly on my laptop. Although I saw there is kernel.sched_tt_balancer_opt = 3, which would enable those energy efficient features, one may not want find_energy_efficient_cpu (removed in xanmod). In addition, there is a recent revived effort of the original latency nice patch, which seems to work differently compared to the current approach in tt.

Hello @raykzhao

Glad that you are still interested to TT. Please check this last commit: https://github.com/hamadmarri/TT-CPU-Scheduler/commit/39e42c25471d4aa2e92756701fb6616621c40c9b

I have changed the lat. sens. a bit and also added sysctl to disable. kernel.sched_tt_lat_sens_enabled = 1

I also added a sticky cpu bound tasks to be in current cpu: kernel.sched_tt_dedicated_cpu_bound_enabled = 1

Regarding the xanmod patch, I will check with Alex about it.

Thank you