Lutris tells me that fsync can improve my performance by making my game use multiple cores, but it needs a patched kernel. What does ‘patched’ mean here? Is it an option I can enable in the kernel config before compiling?
Here’s quick tl;dr from my Linux gaming guide:
-
It’s not universal improvement, depending on a game it may vary, but generally speaking very modern multi-core capable games can benefit significantly.
-
You’d need Kernel ready for Fsync, in case of Arch it’s:
- zen
- @anon31687413’s Kernel linux-vd have this patch
- You can patch any Kernel yourself (for a patch ask @anon31687413 he knows it best)
-
To enable Fsync you also need a special version of Wine capable of that:
-
TKG
- Manually patched Wine build
-
TKG
-
Finally you can just enable it in Lutris if all conditions met
Select game, Right
Button -> Configure
Runner options tab:
Enable Fsync - same as Esync, should be better, but Engine and Kernel must support it!
Lutris will alert you if it’s not supported by Engine in use
Also i think you need to disable Esync then, coz they effectively cancel each other and Fsync is more performant, but little less compatible for now
Since the zen kernel has the patches, I guess I would like to use that (I would also like to learn how to apply patches myself, but that’s a bit more complicated I guess*). However, I also want to change some kernel options before compiling, so I can’t just install the binary linux-zen
package from the repos. What I want to do here is basically follow the methods instructed here (or, if that won’t do, here), except with the zen kernel. How would I go about doing that?
In the case of compiling a kernel traditionally, the wiki says that I need a tar.xz file, but I could not find such a file in the official zen repo? So how would I go about doing this?
One Idea I had was to edit the PKGBUILD of the linux-lqx kernel (which has fsync support, right?) so that I’ll be able to use make nconfig
before compiling, but how do I actually edit the PKGBUILD that way?
*So according to the first wiki page in this comment, applying patches yourself should be as simple as copying a patch file into the build directory. However, the fsync patch can’t be found anywhere.
Edit: So I viewed the PKGBUILD for linux-lqx
and it starts like this:
# Maintainer: Piotr Gorski <lucjan.lucjanov@gmail.com> PGP-Key: BDB26C5A
# Contributor: shivik <> PGP-Key: 761E423C
# Contributor: Michael Duell <mail@akurei.me> PGP-Key: 6EE23EBE
# A special thanks to Steven Barrett for very important suggestions
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
### BUILD OPTIONS
# Set these variables to ANYTHING that is not null to enable them
### Tweak kernel options prior to a build via nconfig
_makenconfig=
### Tweak kernel options prior to a build via menuconfig
_makemenuconfig=
### Tweak kernel options prior to a build via xconfig
_makexconfig=
....
....
So am I supposed to just remove the underscore on line 13 and be done with it?
The “traditional” kernel compilation method as described on Arch Wiki is good for educational purposes, but for a “real” kernel you will want to use PKGBUILDs so as to integrate it into the package management.
You add that exact command more or less at the end of the prepare()
function.
You obviously have to add it to the source array and add the patch command (see the PM I sent you). EDIT: no need to add patch command, both linux
and linux-lqx
iterate through the source array.
No, you have to do as described above: set to a non-null value because of the check [[ -z $_makenconfig ]]
Let’s call the patch you linked fsync.patch (I can rename it, right?). All of this is just to clarify:
After asp update linux
and asp export linux
, and downloading the patch, my build directory should look like this:
└── linux
├── config
├── fsync.patch
└── PKGBUILD
My source array should look like this:
18 source=(
19 "$_srcname::git+https://git.archlinux.org/linux.git?signed#tag
=$_srctag"
20 config # the main kernel config file
21 fsync.patch
22 )
And as per your edit, my prepare() should remain unchanged, except the make nconfig
at the end:
34 prepare() {
35 cd $_srcname
36
37 echo "Setting version..."
38 scripts/setlocalversion --save-scmversion
39 echo "-$pkgrel" > localversion.10-pkgrel
40 echo "${pkgbase#linux}" > localversion.20-pkgname
41
42 local src
43 for src in "${source[@]}"; do
44 src="${src%%::*}"
45 src="${src##*/}"
46 [[ $src = *.patch ]] || continue
47 echo "Applying patch $src..."
48 patch -Np1 < "../$src"
49 done
50
51 echo "Setting config..."
52 cp ../config .config
53 #make olddefconfig
54
55 make nconfig
56 make prepare
57
58 make -s kernelrelease > version
59 echo "Prepared $pkgbase version $(<version)"
60 }
So it’s ok if it’s _makenconfig=1
?
I don’t use asp
so I cannot comment on that.
For all the rest, yes, it should work. Maybe put make nconfig
after make prepare
.
Just try it out.