+ ksm-replace-smp_read_barrier_depends-with-lockless_dereference.patch added to -mm tree

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

 



The patch titled
     Subject: ksm: replace smp_read_barrier_depends() with lockless_dereference()
has been added to the -mm tree.  Its filename is
     ksm-replace-smp_read_barrier_depends-with-lockless_dereference.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/ksm-replace-smp_read_barrier_depends-with-lockless_dereference.patch
		echo and later at
		echo  http://ozlabs.org/~akpm/mmotm/broken-out/ksm-replace-smp_read_barrier_depends-with-lockless_dereference.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/SubmitChecklist when testing your code ***

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

------------------------------------------------------
From: Pranith Kumar <bobby.prani@xxxxxxxxx>
Subject: ksm: replace smp_read_barrier_depends() with lockless_dereference()

Recently lockless_dereference() was added which can be used in place of
hard-coding smp_read_barrier_depends().  The following PATCH makes the
change.

Signed-off-by: Pranith Kumar <bobby.prani@xxxxxxxxx>
Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
Cc: Hugh Dickins <hughd@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/ksm.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff -puN mm/ksm.c~ksm-replace-smp_read_barrier_depends-with-lockless_dereference mm/ksm.c
--- a/mm/ksm.c~ksm-replace-smp_read_barrier_depends-with-lockless_dereference
+++ a/mm/ksm.c
@@ -542,15 +542,14 @@ static struct page *get_ksm_page(struct
 	expected_mapping = (void *)stable_node +
 				(PAGE_MAPPING_ANON | PAGE_MAPPING_KSM);
 again:
-	kpfn = ACCESS_ONCE(stable_node->kpfn);
-	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();
+	kpfn = lockless_dereference(stable_node->kpfn);
+	page = pfn_to_page(kpfn);
+
 	if (ACCESS_ONCE(page->mapping) != expected_mapping)
 		goto stale;
 
_

Patches currently in -mm which might be from bobby.prani@xxxxxxxxx are

ksm-replace-smp_read_barrier_depends-with-lockless_dereference.patch
linux-next.patch
slab-replace-smp_read_barrier_depends-with-lockless_dereference.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux