diff options
author | Jason Low <jason.low2@hp.com> | 2015-04-15 19:14:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:18 -0400 |
commit | 4db0c3c2983cc6b7a08a33542af5e14de8a9258c (patch) | |
tree | 66cfeaeae432f904c09af45e030b7e1e00476011 /mm/ksm.c | |
parent | 9d8c47e4bb1c20dbceee437f9fa7d76dafee80a2 (diff) |
mm: remove rest of ACCESS_ONCE() usages
We converted some of the usages of ACCESS_ONCE to READ_ONCE in the mm/
tree since it doesn't work reliably on non-scalar types.
This patch removes the rest of the usages of ACCESS_ONCE, and use the new
READ_ONCE API for the read accesses. This makes things cleaner, instead
of using separate/multiple sets of APIs.
Signed-off-by: Jason Low <jason.low2@hp.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Davidlohr Bueso <dave@stgolabs.net>
Acked-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/ksm.c')
-rw-r--r-- | mm/ksm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -542,7 +542,7 @@ static struct page *get_ksm_page(struct stable_node *stable_node, bool lock_it) | |||
542 | expected_mapping = (void *)stable_node + | 542 | expected_mapping = (void *)stable_node + |
543 | (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM); | 543 | (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM); |
544 | again: | 544 | again: |
545 | kpfn = ACCESS_ONCE(stable_node->kpfn); | 545 | kpfn = READ_ONCE(stable_node->kpfn); |
546 | page = pfn_to_page(kpfn); | 546 | page = pfn_to_page(kpfn); |
547 | 547 | ||
548 | /* | 548 | /* |
@@ -551,7 +551,7 @@ again: | |||
551 | * but on Alpha we need to be more careful. | 551 | * but on Alpha we need to be more careful. |
552 | */ | 552 | */ |
553 | smp_read_barrier_depends(); | 553 | smp_read_barrier_depends(); |
554 | if (ACCESS_ONCE(page->mapping) != expected_mapping) | 554 | if (READ_ONCE(page->mapping) != expected_mapping) |
555 | goto stale; | 555 | goto stale; |
556 | 556 | ||
557 | /* | 557 | /* |
@@ -577,14 +577,14 @@ again: | |||
577 | cpu_relax(); | 577 | cpu_relax(); |
578 | } | 578 | } |
579 | 579 | ||
580 | if (ACCESS_ONCE(page->mapping) != expected_mapping) { | 580 | if (READ_ONCE(page->mapping) != expected_mapping) { |
581 | put_page(page); | 581 | put_page(page); |
582 | goto stale; | 582 | goto stale; |
583 | } | 583 | } |
584 | 584 | ||
585 | if (lock_it) { | 585 | if (lock_it) { |
586 | lock_page(page); | 586 | lock_page(page); |
587 | if (ACCESS_ONCE(page->mapping) != expected_mapping) { | 587 | if (READ_ONCE(page->mapping) != expected_mapping) { |
588 | unlock_page(page); | 588 | unlock_page(page); |
589 | put_page(page); | 589 | put_page(page); |
590 | goto stale; | 590 | goto stale; |
@@ -600,7 +600,7 @@ stale: | |||
600 | * before checking whether node->kpfn has been changed. | 600 | * before checking whether node->kpfn has been changed. |
601 | */ | 601 | */ |
602 | smp_rmb(); | 602 | smp_rmb(); |
603 | if (ACCESS_ONCE(stable_node->kpfn) != kpfn) | 603 | if (READ_ONCE(stable_node->kpfn) != kpfn) |
604 | goto again; | 604 | goto again; |
605 | remove_node_from_stable_tree(stable_node); | 605 | remove_node_from_stable_tree(stable_node); |
606 | return NULL; | 606 | return NULL; |