Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

failing to apply a patch on Ubuntu 5.4 kernel #66

Closed
hellt opened this issue Feb 17, 2021 · 2 comments
Closed

failing to apply a patch on Ubuntu 5.4 kernel #66

hellt opened this issue Feb 17, 2021 · 2 comments

Comments

@hellt
Copy link

hellt commented Feb 17, 2021

Hi,
Can you please tell me if I am doing something wrong when trying to patch Ubuntu 5.4 kernel with UKSM support?

git clone --depth 1 --single-branch --branch Ubuntu-5.4.0-66.74 https://git.launchpad.net/\~ubuntu-kernel/ubuntu/+source/linux/+git/focal

cd focal

# start patch
root@kernel-build:~/focal# patch -p1 < ~/uksm/v5.x/uksm-5.4.patch
patching file Documentation/vm/uksm.txt
patching file fs/exec.c
Hunk #1 succeeded at 63 with fuzz 2.
patching file fs/proc/meminfo.c
patching file include/asm-generic/pgtable.h
patching file include/linux/ksm.h
patching file include/linux/mm_types.h
Hunk #1 succeeded at 355 (offset 2 lines).
patching file include/linux/mmzone.h
patching file include/linux/sradix-tree.h
patching file include/linux/uksm.h
patching file kernel/fork.c
Hunk #1 succeeded at 600 (offset 5 lines).
patching file lib/Makefile
patching file lib/sradix-tree.c
patching file mm/Kconfig
patching file mm/Makefile
patching file mm/ksm.c
patching file mm/memory.c
Hunk #1 succeeded at 142 (offset 12 lines).
Hunk #2 succeeded at 172 (offset 12 lines).
Hunk #3 succeeded at 804 (offset 12 lines).
Hunk #4 succeeded at 1083 (offset 12 lines).
Hunk #5 FAILED at 2196.
Hunk #6 succeeded at 2446 (offset 97 lines).
Hunk #7 succeeded at 2488 (offset 109 lines).
1 out of 7 hunks FAILED -- saving rejects to file mm/memory.c.rej
patching file mm/mmap.c
Hunk #2 succeeded at 179 with fuzz 2 (offset -6 lines).
Hunk #3 succeeded at 730 (offset -8 lines).
Hunk #4 succeeded at 872 (offset -8 lines).
Hunk #5 succeeded at 978 (offset -8 lines).
Hunk #6 succeeded at 1005 (offset -8 lines).
Hunk #7 succeeded at 1472 (offset -8 lines).
Hunk #8 succeeded at 1843 (offset -10 lines).
Hunk #9 succeeded at 1886 (offset -10 lines).
Hunk #10 succeeded at 2729 (offset 3 lines).
Hunk #11 succeeded at 3054 (offset 21 lines).
Hunk #12 succeeded at 3105 (offset 21 lines).
Hunk #13 succeeded at 3183 (offset 21 lines).
Hunk #14 succeeded at 3224 with fuzz 1 (offset 22 lines).
Hunk #15 succeeded at 3336 (offset 22 lines).
Hunk #16 succeeded at 3487 (offset 22 lines).
patching file mm/uksm.c
patching file mm/vmstat.c
root@kernel-build:~/focal# cat mm/memory.c.
memory.c.orig  memory.c.rej
root@kernel-build:~/focal# cat mm/memory.c.
memory.c.orig  memory.c.rej
root@kernel-build:~/focal# cat mm/memory.c.
memory.c.orig  memory.c.rej


# check reject
root@kernel-build:~/focal# cat mm/memory.c.rej
--- mm/memory.c
+++ mm/memory.c
@@ -2196,8 +2223,10 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo
 			clear_page(kaddr);
 		kunmap_atomic(kaddr);
 		flush_dcache_page(dst);
-	} else
+	} else {
 		copy_user_highpage(dst, src, va, vma);
+		uksm_cow_page(vma, src);
+	}
 }

 static gfp_t __get_fault_gfp_mask(struct vm_area_struct *vma)
@hellt hellt changed the title failing to apply a patch on Ubuntu 5.4 failing to apply a patch on Ubuntu 5.4 kernel Feb 17, 2021
@dolohow
Copy link
Owner

dolohow commented Feb 17, 2021

UKSM is only supported for vanilla sources from kernel.org without any other patches applied on them. They might work, though. You can try 5.5 patch, no idea if that would work. Ubuntu back ported some changes. Also, there is a new Ubuntu hwe kernel created from 5.8 branch, you can try that as well if possible.

Hope that helps.

@dolohow dolohow closed this as completed Feb 17, 2021
@hellt
Copy link
Author

hellt commented Feb 17, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants