hakavlad / le9-patch

[PATCH] mm: Protect the working set under memory pressure to prevent thrashing, avoid high latency and prevent livelock in near-OOM conditions
Creative Commons Zero v1.0 Universal
190 stars 9 forks source link

Applying the patch #11

Open Darth-Ness opened 3 years ago

Darth-Ness commented 3 years ago

So, this laptop (not exactly sure how old it is, but it was running XP and system BIOS said it was 2004) I have the 32-bit version installed on it. The kernel version is 4.19 so using the "patch" command I tried to run the patch file. The command line after several minuets still would not print anything. Should I have used some flags?

kakra commented 3 years ago

patch doesn't take a filename for the patch as parameter but the name of the file to patch. patch expects patches on stdin.

So you'd need to run patch <le9patch.patch to patch the files. Without any file name, it will patch all the files mentioned in the patch. You probably need to exclude the first path component if the patch was exported via git (it will prepend a/ and b/ to each file path). You can look at the patch file with an editor to find out. patch -p1 <le9patch.patch would remove the first path component.

hakavlad commented 3 years ago

Example: enter the kernel directory and run patch command (the patch itself is outside the kernel directory):

linux-5.14-rc6$ patch -p1 < ../le9eb-5.14-rc1.patch
checking file Documentation/admin-guide/sysctl/vm.rst
checking file include/linux/mm.h
checking file kernel/sysctl.c
checking file mm/Kconfig
checking file mm/vmscan.c
Darth-Ness commented 3 years ago

Okay, thanks for the help. This is my first time using this command so I didn't expect it to work way. I close this issue if that works.

Darth-Ness commented 3 years ago

So after running the above commands, it outputted what looked like the contents of the patch, then asked me to choose a patch file.

hakavlad commented 3 years ago

Could you please show the output and what command you run?

Darth-Ness commented 3 years ago

"patch -p1 < /home/user/Desktop/le9-patch/le9eb_patches/le9eb-4.19.patch" was the command. The output is actually the "le9eb patch" part of the readme.

kakra commented 3 years ago

Please run pwd && ls at the same directory you tried to use the patch command.

Darth-Ness commented 3 years ago

It outputted this "/boot config-4.19.0-17-686-pae grub initrd.img-4.19.0-17-686-pae System.map-4.19.0-17-686-pae vmlinuz-4.19.0-17-686-pae "

hakavlad commented 3 years ago

@Darth-Ness you are not in the kernel directory. Output should be like

$ pwd && ls
/home/user/KERNEL/_linux419/linux
arch   certs    CREDITS  Documentation  firmware  include  ipc     Kconfig  LICENSES     Makefile  net     samples  security  tools  virt
block  COPYING  crypto   drivers        fs        init     Kbuild  kernel   lib               MAINTAINERS  mm        README  scripts  sound     usr
kakra commented 3 years ago

@Darth-Ness I think this will becoming more complicated than you thought. What you need to do is actually compile your kernel from source. If you never did that before, there's a lot to learn first. It may be easier to just get a binary kernel image built for your distribution from someone else who also included the patch. I think there are some people who provide such kernels and already adopted this patchset. @hakavlad may know better which do.

It would help if you tell us which distribution you're using.

Darth-Ness commented 3 years ago

It is using the Debian 32-bit version

Darth-Ness commented 3 years ago

Okay, after looking around for a kernel, I have found none. Any ideas?

Wait never mind I think I found one.

hakavlad commented 3 years ago

I `ll answer later. I just recently built a kernel for Debian 11 i686.