summarylogtreecommitdiffstats
path: root/0002-UKSM.patch
diff options
context:
space:
mode:
authorHouge Langley2021-02-26 09:29:12 +0800
committerHouge Langley2021-02-26 09:29:12 +0800
commita12ed729567cfcecd11a282008a8b04110cac75d (patch)
treed4e1989cab091680919227c4a304920d6768cfcb /0002-UKSM.patch
parent0f86e475758285e2d3a9369a4bda6f0cefe2e5a7 (diff)
downloadaur-a12ed729567cfcecd11a282008a8b04110cac75d.tar.gz
Update to v5.11.1-2
Diffstat (limited to '0002-UKSM.patch')
-rw-r--r--0002-UKSM.patch76
1 files changed, 38 insertions, 38 deletions
diff --git a/0002-UKSM.patch b/0002-UKSM.patch
index dfadb980760d..9a8be4e28392 100644
--- a/0002-UKSM.patch
+++ b/0002-UKSM.patch
@@ -1,7 +1,7 @@
-From 7d21ce8f371b7bc46c2e23cbca1c85aed6450141 Mon Sep 17 00:00:00 2001
+From 54c4e5ae42627a450d15d126302ecc5509ba1e26 Mon Sep 17 00:00:00 2001
From: Piotr Gorski <lucjan.lucjanov@gmail.com>
-Date: Sun, 6 Dec 2020 23:49:33 +0100
-Subject: [PATCH] UKSM for 5.10
+Date: Wed, 16 Dec 2020 01:40:01 +0100
+Subject: [PATCH] UKSM for 5.11
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
---
@@ -33,7 +33,7 @@ Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
diff --git a/Documentation/vm/uksm.txt b/Documentation/vm/uksm.txt
new file mode 100644
-index 0000000..be19a31
+index 000000000..be19a3127
--- /dev/null
+++ b/Documentation/vm/uksm.txt
@@ -0,0 +1,61 @@
@@ -99,25 +99,25 @@ index 0000000..be19a31
+2016-09-10 UKSM 0.1.2.5 Fix a bug in dedup ratio calculation.
+2017-02-26 UKSM 0.1.2.6 Fix a bug in hugetlbpage handling and a race bug with page migration.
diff --git a/fs/exec.c b/fs/exec.c
-index 547a239..fc64a20 100644
+index 5d4d52039..86f9f6526 100644
--- a/fs/exec.c
+++ b/fs/exec.c
-@@ -64,6 +64,7 @@
- #include <linux/compat.h>
+@@ -65,6 +65,7 @@
#include <linux/vmalloc.h>
#include <linux/io_uring.h>
+ #include <linux/syscall_user_dispatch.h>
+#include <linux/ksm.h>
#include <linux/uaccess.h>
#include <asm/mmu_context.h>
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
-index 887a553..581a676 100644
+index d6fc74619..7b929bbd2 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -108,7 +108,10 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
#endif
show_val_kb(m, "PageTables: ",
- global_zone_page_state(NR_PAGETABLE));
+ global_node_page_state(NR_PAGETABLE));
-
+#ifdef CONFIG_UKSM
+ show_val_kb(m, "KsmZeroPages: ",
@@ -127,7 +127,7 @@ index 887a553..581a676 100644
show_val_kb(m, "Bounce: ",
global_zone_page_state(NR_BOUNCE));
diff --git a/include/linux/ksm.h b/include/linux/ksm.h
-index 161e816..f0dbdf3 100644
+index 161e8164a..f0dbdf3c9 100644
--- a/include/linux/ksm.h
+++ b/include/linux/ksm.h
@@ -21,20 +21,16 @@ struct mem_cgroup;
@@ -198,10 +198,10 @@ index 161e816..f0dbdf3 100644
+
#endif /* __LINUX_KSM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index 5a9238f..5dd1ccf 100644
+index 07d9acb5b..858a2f712 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
-@@ -371,6 +371,9 @@ struct vm_area_struct {
+@@ -369,6 +369,9 @@ struct vm_area_struct {
struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif
struct vm_userfaultfd_ctx vm_userfaultfd_ctx;
@@ -212,10 +212,10 @@ index 5a9238f..5dd1ccf 100644
struct core_thread {
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index fb3bf69..e4477c3 100644
+index b593316bf..90d5b5a43 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
-@@ -159,6 +159,9 @@ enum zone_stat_item {
+@@ -157,6 +157,9 @@ enum zone_stat_item {
NR_ZSPAGES, /* allocated in zsmalloc */
#endif
NR_FREE_CMA_PAGES,
@@ -226,10 +226,10 @@ index fb3bf69..e4477c3 100644
enum node_stat_item {
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
-index e237004..092cdfb 100644
+index 8fcdfa52e..cc511ae57 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
-@@ -1060,12 +1060,25 @@ extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
+@@ -1115,12 +1115,25 @@ extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
extern void untrack_pfn_moved(struct vm_area_struct *vma);
#endif
@@ -256,7 +256,7 @@ index e237004..092cdfb 100644
}
#define my_zero_pfn(addr) page_to_pfn(ZERO_PAGE(addr))
-@@ -1074,7 +1087,7 @@ static inline int is_zero_pfn(unsigned long pfn)
+@@ -1129,7 +1142,7 @@ static inline int is_zero_pfn(unsigned long pfn)
static inline int is_zero_pfn(unsigned long pfn)
{
extern unsigned long zero_pfn;
@@ -267,7 +267,7 @@ index e237004..092cdfb 100644
static inline unsigned long my_zero_pfn(unsigned long addr)
diff --git a/include/linux/sradix-tree.h b/include/linux/sradix-tree.h
new file mode 100644
-index 0000000..d71edba
+index 000000000..d71edba6b
--- /dev/null
+++ b/include/linux/sradix-tree.h
@@ -0,0 +1,77 @@
@@ -350,7 +350,7 @@ index 0000000..d71edba
+#endif /* _LINUX_SRADIX_TREE_H */
diff --git a/include/linux/uksm.h b/include/linux/uksm.h
new file mode 100644
-index 0000000..bb8651f
+index 000000000..bb8651f53
--- /dev/null
+++ b/include/linux/uksm.h
@@ -0,0 +1,149 @@
@@ -504,10 +504,10 @@ index 0000000..bb8651f
+#endif /* !CONFIG_UKSM */
+#endif /* __LINUX_UKSM_H */
diff --git a/kernel/fork.c b/kernel/fork.c
-index a106335..7392447 100644
+index e39846a73..aaab0f873 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -591,7 +591,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
+@@ -588,7 +588,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
__vma_link_rb(mm, tmp, rb_link, rb_parent);
rb_link = &tmp->vm_rb.rb_right;
rb_parent = &tmp->vm_rb;
@@ -517,7 +517,7 @@ index a106335..7392447 100644
if (!(tmp->vm_flags & VM_WIPEONFORK))
retval = copy_page_range(tmp, mpnt);
diff --git a/lib/Makefile b/lib/Makefile
-index d415fc7..e4045eb 100644
+index afeff05fa..691f13e0f 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,7 +31,7 @@ endif
@@ -531,7 +531,7 @@ index d415fc7..e4045eb 100644
is_single_threaded.o plist.o decompress.o kobject_uevent.o \
diff --git a/lib/sradix-tree.c b/lib/sradix-tree.c
new file mode 100644
-index 0000000..ab21e63
+index 000000000..ab21e6309
--- /dev/null
+++ b/lib/sradix-tree.c
@@ -0,0 +1,476 @@
@@ -1012,10 +1012,10 @@ index 0000000..ab21e63
+ return 0;
+}
diff --git a/mm/Kconfig b/mm/Kconfig
-index 390165f..50d02cf 100644
+index 5f4846c7d..40bf1a135 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
-@@ -317,6 +317,32 @@ config KSM
+@@ -352,6 +352,32 @@ config KSM
See Documentation/vm/ksm.rst for more information: KSM is inactive
until a program has madvised that an area is MADV_MERGEABLE, and
root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
@@ -1049,7 +1049,7 @@ index 390165f..50d02cf 100644
config DEFAULT_MMAP_MIN_ADDR
int "Low address space to protect from user allocation"
diff --git a/mm/Makefile b/mm/Makefile
-index d73aed0..d6612b7 100644
+index b6cd2fffa..abe1ab4d4 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -76,7 +76,8 @@ obj-$(CONFIG_SPARSEMEM) += sparse.o
@@ -1063,7 +1063,7 @@ index d73aed0..d6612b7 100644
obj-$(CONFIG_SLAB) += slab.o
obj-$(CONFIG_SLUB) += slub.o
diff --git a/mm/ksm.c b/mm/ksm.c
-index 3c51c71..9e82895 100644
+index 50d1d6dd1..a10d21de2 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -858,17 +858,6 @@ static int unmerge_ksm_pages(struct vm_area_struct *vma,
@@ -1085,7 +1085,7 @@ index 3c51c71..9e82895 100644
/*
* Only called through the sysfs control interface:
diff --git a/mm/memory.c b/mm/memory.c
-index 01495c1..c651f01 100644
+index feff48e14..9fe7c8e59 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -146,6 +146,25 @@ EXPORT_SYMBOL(zero_pfn);
@@ -1134,7 +1134,7 @@ index 01495c1..c651f01 100644
}
/*
-@@ -1237,8 +1262,10 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
+@@ -1248,8 +1273,10 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
ptent = ptep_get_and_clear_full(mm, addr, pte,
tlb->fullmm);
tlb_remove_tlb_entry(tlb, pte, addr);
@@ -1146,7 +1146,7 @@ index 01495c1..c651f01 100644
if (!PageAnon(page)) {
if (pte_dirty(ptent)) {
-@@ -2587,6 +2614,7 @@ static inline bool cow_user_page(struct page *dst, struct page *src,
+@@ -2597,6 +2624,7 @@ static inline bool cow_user_page(struct page *dst, struct page *src,
if (likely(src)) {
copy_user_highpage(dst, src, addr, vma);
@@ -1154,7 +1154,7 @@ index 01495c1..c651f01 100644
return true;
}
-@@ -2833,6 +2861,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
+@@ -2843,6 +2871,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
vmf->address);
if (!new_page)
goto oom;
@@ -1162,7 +1162,7 @@ index 01495c1..c651f01 100644
} else {
new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma,
vmf->address);
-@@ -2875,7 +2904,9 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
+@@ -2885,7 +2914,9 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
mm_counter_file(old_page));
inc_mm_counter_fast(mm, MM_ANONPAGES);
}
@@ -1173,7 +1173,7 @@ index 01495c1..c651f01 100644
}
flush_cache_page(vma, vmf->address, pte_pfn(vmf->orig_pte));
diff --git a/mm/mmap.c b/mm/mmap.c
-index 5c8b448..b8dd56d 100644
+index dc7206032..f2b9cbd7f 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -46,6 +46,7 @@
@@ -1324,7 +1324,7 @@ index 5c8b448..b8dd56d 100644
}
return new_vma;
-@@ -3491,6 +3527,7 @@ static struct vm_area_struct *__install_special_mapping(
+@@ -3507,6 +3543,7 @@ static struct vm_area_struct *__install_special_mapping(
vm_stat_account(mm, vma->vm_flags, len >> PAGE_SHIFT);
perf_event_mmap(vma);
@@ -1334,7 +1334,7 @@ index 5c8b448..b8dd56d 100644
diff --git a/mm/uksm.c b/mm/uksm.c
new file mode 100644
-index 0000000..e4732c0
+index 000000000..e4732c00b
--- /dev/null
+++ b/mm/uksm.c
@@ -0,0 +1,5614 @@
@@ -6953,12 +6953,12 @@ index 0000000..e4732c0
+#endif
+
diff --git a/mm/vmstat.c b/mm/vmstat.c
-index c81737a..319f5f8 100644
+index 6b9369fd9..24cb8a8ff 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1216,6 +1216,9 @@ const char * const vmstat_text[] = {
- "nr_shadow_call_stack",
#endif
+ "nr_page_table_pages",
+#ifdef CONFIG_UKSM
+ "nr_uksm_zero_pages",
@@ -6967,5 +6967,5 @@ index c81737a..319f5f8 100644
"nr_dirty_threshold",
"nr_dirty_background_threshold",
--
-2.29.2.456.g3a0b884cab
+2.30.1.457.gf011795891