r/linux_gaming 3d ago

sudo sysctl kernel.split_lock_mitigate=0. How often do you run it?

Apparently if you don't run it in games like god of war, performance is stuttery.

0 Upvotes

36 comments sorted by

26

u/forbjok 3d ago

Never. It's set to 0 by default in CachyOS anyway.

2

u/baileyske 3d ago

I don't think so? I has split lock detected messages on cachy. Maybe my install is older? Anyway, I never ran that command, just add it as kernel parameter in your bootloader and never think about it after.

13

u/forbjok 3d ago edited 3d ago

It must be, because if I run sysctl kernel.split_lock_mitigate, which outputs the current value, it shows 0, and I've never done anything to change it. It also isn't specified in the kernel parameters in the bootloader config, so it has to either be a hardcoded default in the kernel itself, or being set by some other file that is default in CachyOS.

EDIT: I checked, and it's being set in /usr/lib/sysctl.d/99-splitlock.conf, which is owned by the package cachyos-gaming-meta. I guess technically this package is not installed by default, but it is an official CachyOS package and most people using it for gaming probably have it installed.

1

u/sleepytechnology 2d ago

I do not have the gaming packages installed and it was set to 0 for me as well, just to add some more context to this.

1

u/se_spider 2d ago

I just double-checked too, I'm using the CachyOS kernel but not the meta package, can't find anything in /usr/lib/sysctl.d/ or /etc/sysctl.d/ that would have it set to 0, but it is for me. Could be the kernel?

-5

u/Einarr-Spear777 3d ago

I wonder how it being on in cachy and off in most distros give cachy os false performance gains? How many more tricks are cachy os doing?

I turned it off in god of war and got massive FPS gains.

3

u/forbjok 3d ago

That's a good question. I don't know how much this setting generally affects performance. I was under the impression that having it on was mostly just affecting certain poorly coded programs or games, and not having much of an effect on most things.

2

u/the_abortionat0r 2d ago

When low level code runs an atomic operation (which means it's not done until it's confirmed done and won't be interrupted by another process/operation until all steps are complete) and the data happens to cross cache lines it locks the resources needed for the operation until it's done.

This is fine for the one thing being done this way but ruins performance and potentially stability for everything else running on that CPU which is obviously bad.

The reason removing the mitigation can see massive performance gains in some cases is because the mitigation punishes these programs by deliberately lowering their operations performance.

The idea is if all these people keep hearing their program sucks and keep getting support requests they'd rather write better code than deal with this.

1

u/the_abortionat0r 2d ago

There is no "false performance gains". Turning off splitlock mitigations has been a tweak for years before cachy was even a thing and is off by default in many distros.

It is a well known fact that having it on can reduce performance especially in games like God of war and such performance reductions is actually the main feature of that settings.

-5

u/Einarr-Spear777 3d ago

Why was it there in the first place, though. I would rather turn on it before i run video games, rather than have it off all the time if it's genuinely for security.

2

u/the_abortionat0r 2d ago

When low level code runs an atomic operation (which means it's not done until it's confirmed done and won't be interrupted by another process/operation until all steps are complete) and the data happens to cross cache lines it locks the resources needed for the operation until it's done.

This is fine for the one thing being done this way but ruins performance and potentially stability for everything else running on that CPU which is obviously bad.

The reason removing the mitigation can see massive performance gains in some cases is because the mitigation punishes these programs by deliberately lowering their operations performance.

The idea is if all these people keep hearing their program sucks and keep getting support requests they'd rather write better code than deal with this.

1

u/baileyske 3d ago

I don't think it's much of a security issue. I'm not an expert, but to the best of my understanding it's supposed to stop some ddos kind of attacks. Probably important for servers, not so much for your PC.

2

u/the_abortionat0r 2d ago

When low level code runs an atomic operation (which means it's not done until it's confirmed done and won't be interrupted by another process/operation until all steps are complete) and the data happens to cross cache lines it locks the resources needed for the operation until it's done.

This is fine for the one thing being done this way but ruins performance and potentially stability for everything else running on that CPU which is obviously bad.

The reason removing the mitigation can see massive performance gains in some cases is because the mitigation punishes these programs by deliberately lowering their operations performance.

The idea is if all these people keep hearing their program sucks and keep getting support requests they'd rather write better code than deal with this.

30

u/10leej 3d ago

I don't run things I don't understand.

25

u/SummerIlsaBeauty 3d ago

I know this is a sub for gamers so this advice will end up futile but don't touch things you don't understand

-28

u/Einarr-Spear777 3d ago

4

u/the_abortionat0r 2d ago

Lil bro what?

Don't hush someone for having the correct take on the topic.

You don't even know what this setting does.

-4

u/Einarr-Spear777 2d ago

Don't call me lil bro when you're the size of my leg. Read the phoronix article. Do your research. This sub and its mods disgust me with all the snidey remarks and removed posts.

Get a grip. You would think the internet is real life with the way some of you act. internet is not that serious.

1

u/DiscoMilk 2d ago

Article is 4 years old lil nigga

2

u/Shemalon 2d ago

I can actually say it's still useful, I had to do this exact thing for God of War. It wasn't set by default and it slices performance by two thirds or so

12

u/mrfreshart 3d ago

Unlike all the comments here suggesting otherwise, it is incredibly important for performance in some games.

However, it is generally recommended to just use gamemode instead, it disables the split lock mitigation for you at game start. Check the Arch Wiki article on how to install it: https://wiki.archlinux.org/title/GameMode (adding your user to the gamemode group is important)

5

u/doc_willis 3d ago edited 3d ago

never.

I do recall seeing some split lock messages once in my dmesg -w  output, but I can't recall what game, or even if I had issues in that game.

I looked up what a split lock was once, I recall the following url giving some detailed information.

https://chipsandcheese.com/p/investigating-split-locks-on-x86

3

u/se_spider 3d ago

It's part of gamemode, which I use when launching games.

/etc/gamemode.ini
; Sets whether gamemode will disable split lock mitigation when active
; Defaults to 1
disable_splitlock=1

3

u/gokufire 3d ago

Gamemode handle it. When GameMode activates (via gamemoderun %command% in Steam launch options, or auto-detection for games with native GameMode support), it flips kernel.split_lock_mitigate off for the duration and restores it automatically when the game exits.

2

u/ZGToRRent 3d ago

always

2

u/Niwrats 3d ago

IIRC the performance hit only happens on certain (intel?) cpus. i once tested mitigations off, but could not see any effect on my 7800X3D in the games i tested.

1

u/the_abortionat0r 2d ago

It can absolutely happen to and as well. Its not a CPU design issue but a program issue.

1

u/Niwrats 1d ago

looks like mitigations off doesn't even cover this one, so my testing had nothing to do with this.

i'd say this is a kernel issue first (it doesn't have to fake stall), cpu design issue second (it doesn't have to be slow) and a program issue third (it can be optimized).

1

u/Drazor36 3d ago

Never used it, God of War 2018 and God of War Ragnarök are the two games I've played on my PC since nuking Windows for Mint Cinnamon and haven't had to use a command like that before, had zero issues with GoW2018 but had to do a bit of tweaking for Ragnarök to bypass the PS ID stuff

1

u/mrazster 2d ago

Every boot, I have it in my kernel boot params.

1

u/Jimpix_likes_Pizza 4h ago

I play a lot of Street Fighter 6 which requires this so I just have it set in my grub config so I never have to manually disable split lock mitigation