Merge tag 'regulator-fix-v4.16-suspend' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / mm / ksm.c
index be8f4576f84211499e269f4c69f993a975a8e0a9..293721f5da702ade0da55724702e0dbe6bf6422c 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -675,15 +675,8 @@ static struct page *get_ksm_page(struct stable_node *stable_node, bool lock_it)
        expected_mapping = (void *)((unsigned long)stable_node |
                                        PAGE_MAPPING_KSM);
 again:
-       kpfn = READ_ONCE(stable_node->kpfn);
+       kpfn = READ_ONCE(stable_node->kpfn); /* Address dependency. */
        page = pfn_to_page(kpfn);
-
-       /*
-        * page is computed from kpfn, so on most architectures reading
-        * page->mapping is naturally ordered after reading node->kpfn,
-        * but on Alpha we need to be more careful.
-        */
-       smp_read_barrier_depends();
        if (READ_ONCE(page->mapping) != expected_mapping)
                goto stale;
 
@@ -2309,7 +2302,7 @@ next_mm:
 
 /**
  * ksm_do_scan  - the ksm scanner main worker function.
- * @scan_npages - number of pages we want to scan before we return.
+ * @scan_npages number of pages we want to scan before we return.
  */
 static void ksm_do_scan(unsigned int scan_npages)
 {