+ mm-move-memcmp_pages-and-pages_identical.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: move memcmp_pages() and pages_identical()
has been added to the -mm tree.  Its filename is
     mm-move-memcmp_pages-and-pages_identical.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-move-memcmp_pages-and-pages_identical.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-move-memcmp_pages-and-pages_identical.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Song Liu <songliubraving@xxxxxx>
Subject: mm: move memcmp_pages() and pages_identical()

Patch series "THP aware uprobe", v13.

This patchset makes uprobe aware of THPs.

Currently, when uprobe is attached to text on THP, the page is split by
FOLL_SPLIT.  As a result, uprobe eliminates the performance benefit of
THP.

This set makes uprobe THP-aware.  Instead of FOLL_SPLIT, we introduces
FOLL_SPLIT_PMD, which only split PMD for uprobe.

After all uprobes within the THP are removed, the PTE-mapped pages are
regrouped as huge PMD.

This set (plus a few THP patches) is also available at

   https://github.com/liu-song-6/linux/tree/uprobe-thp


This patch (of 6):

Move memcmp_pages() to mm/util.c and pages_identical() to mm.h, so that we
can use them in other files.

Link: http://lkml.kernel.org/r/20190815164525.1848545-2-songliubraving@xxxxxx
Signed-off-by: Song Liu <songliubraving@xxxxxx>
Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
Reviewed-by: Oleg Nesterov <oleg@xxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Matthew Wilcox <matthew.wilcox@xxxxxxxxxx>
Cc: William Kucharski <william.kucharski@xxxxxxxxxx>
Cc: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/mm.h |    7 +++++++
 mm/ksm.c           |   18 ------------------
 mm/util.c          |   13 +++++++++++++
 3 files changed, 20 insertions(+), 18 deletions(-)

--- a/include/linux/mm.h~mm-move-memcmp_pages-and-pages_identical
+++ a/include/linux/mm.h
@@ -2910,5 +2910,12 @@ void __init setup_nr_node_ids(void);
 static inline void setup_nr_node_ids(void) {}
 #endif
 
+extern int memcmp_pages(struct page *page1, struct page *page2);
+
+static inline int pages_identical(struct page *page1, struct page *page2)
+{
+	return !memcmp_pages(page1, page2);
+}
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MM_H */
--- a/mm/ksm.c~mm-move-memcmp_pages-and-pages_identical
+++ a/mm/ksm.c
@@ -1029,24 +1029,6 @@ static u32 calc_checksum(struct page *pa
 	return checksum;
 }
 
-static int memcmp_pages(struct page *page1, struct page *page2)
-{
-	char *addr1, *addr2;
-	int ret;
-
-	addr1 = kmap_atomic(page1);
-	addr2 = kmap_atomic(page2);
-	ret = memcmp(addr1, addr2, PAGE_SIZE);
-	kunmap_atomic(addr2);
-	kunmap_atomic(addr1);
-	return ret;
-}
-
-static inline int pages_identical(struct page *page1, struct page *page2)
-{
-	return !memcmp_pages(page1, page2);
-}
-
 static int write_protect_page(struct vm_area_struct *vma, struct page *page,
 			      pte_t *orig_pte)
 {
--- a/mm/util.c~mm-move-memcmp_pages-and-pages_identical
+++ a/mm/util.c
@@ -783,3 +783,16 @@ out_mm:
 out:
 	return res;
 }
+
+int memcmp_pages(struct page *page1, struct page *page2)
+{
+	char *addr1, *addr2;
+	int ret;
+
+	addr1 = kmap_atomic(page1);
+	addr2 = kmap_atomic(page2);
+	ret = memcmp(addr1, addr2, PAGE_SIZE);
+	kunmap_atomic(addr2);
+	kunmap_atomic(addr1);
+	return ret;
+}
_

Patches currently in -mm which might be from songliubraving@xxxxxx are

filemap-check-compound_headpage-mapping-in-filemap_fault.patch
filemap-check-compound_headpage-mapping-in-pagecache_get_page.patch
filemap-update-offset-check-in-filemap_fault.patch
mmthp-stats-for-file-backed-thp.patch
khugepaged-rename-collapse_shmem-and-khugepaged_scan_shmem.patch
mmthp-add-read-only-thp-support-for-non-shmem-fs.patch
mmthp-add-read-only-thp-support-for-non-shmem-fs-fix.patch
mmthp-add-read-only-thp-support-for-non-shmem-fs-fix-2.patch
mmthp-avoid-writes-to-file-with-thp-in-pagecache.patch
mm-move-memcmp_pages-and-pages_identical.patch
uprobe-use-original-page-when-all-uprobes-are-removed.patch
mm-thp-introduce-foll_split_pmd.patch
uprobe-use-foll_split_pmd-instead-of-foll_split.patch
khugepaged-enable-collapse-pmd-for-pte-mapped-thp.patch
uprobe-collapse-thp-pmd-after-removing-all-uprobes.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux