History

Merge branch 'simplify-do_wp_page'

Merge emailed patches from Peter Xu: "This is a small series that I picked up from Linus's suggestion to simplify cow handling (and also make it more strict) by checking against page refcounts rather than mapcounts. This makes uffd-wp work again (verified by running upmapsort)" Note: this is horrendously bad timing, and making this kind of fundamental vm change after -rc3 is not at all how things should work. The saving grace is that it really is a a nice simplification: 8 files changed, 29 insertions(+), 120 deletions(-) The reason for the bad timing is that it turns out that commit 17839856fd58 ("gup: document and work around 'COW can break either way' issue" broke not just UFFD functionality (as Peter noticed), but Mikulas Patocka also reports that it caused issues for strace when running in a DAX environment with ext4 on a persistent memory setup. And we can't just revert that commit without re-introducing the original issue that is a potential security hole, so making COW stricter (and in the process much simpler) is a step to then undoing the forced COW that broke other uses. Link: https://lore.kernel.org/lkml/alpine.LRH.2.02.2009031328040.6929@file01.intranet.prod.int.rdu2.redhat.com/ * emailed patches from Peter Xu <peterx@redhat.com>: mm: Add PGREUSE counter mm/gup: Remove enfornced COW mechanism mm/ksm: Remove reuse_ksm_page() mm: do_wp_page() simplification

Linus Torvalds committed 6 years ago

Commit b25d1dc2 parents cfc905f 798a6b88 files · +29 −120Browse files

Showing the changes to include/linux (2 of 8 files). Show all

Unified · Split

2 files
  1. include/linux/ksm.h +0 −7
  2. include/linux/vm_event_item.h +1 −0
include/linux/ksm.h+0−7
@@ -53,8 +53,6 @@ struct page *ksm_might_need_to_copy(struct page *page, · 52 unmodified lines
5353
5454 void rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc);
5555 void ksm_migrate_page(struct page *newpage, struct page *oldpage);
56−bool reuse_ksm_page(struct page *page,
57− struct vm_area_struct *vma, unsigned long address);
5856
5957 #else /* !CONFIG_KSM */
6058
@@ -88,11 +86,6 @@ static inline void rmap_walk_ksm(struct page *page, · 27 unmodified lines
8886 static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage)
8987 {
9088 }
91−static inline bool reuse_ksm_page(struct page *page,
92− struct vm_area_struct *vma, unsigned long address)
93−{
94− return false;
95−}
9689 #endif /* CONFIG_MMU */
9790 #endif /* !CONFIG_KSM */
9891
include/linux/vm_event_item.h+1−0
@@ -30,6 +30,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, · 29 unmodified lines
3030 PGFAULT, PGMAJFAULT,
3131 PGLAZYFREED,
3232 PGREFILL,
33+ PGREUSE,
3334 PGSTEAL_KSWAPD,
3435 PGSTEAL_DIRECT,
3536 PGSCAN_KSWAPD,