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>
This commit is contained in:

committed by
Linus Torvalds

parent
9d8c47e4bb
commit
4db0c3c298
@@ -224,13 +224,13 @@ static inline unsigned long page_order(struct page *page)
|
||||
* PageBuddy() should be checked first by the caller to minimize race window,
|
||||
* and invalid values must be handled gracefully.
|
||||
*
|
||||
* ACCESS_ONCE is used so that if the caller assigns the result into a local
|
||||
* READ_ONCE is used so that if the caller assigns the result into a local
|
||||
* variable and e.g. tests it for valid range before using, the compiler cannot
|
||||
* decide to remove the variable and inline the page_private(page) multiple
|
||||
* times, potentially observing different values in the tests and the actual
|
||||
* use of the result.
|
||||
*/
|
||||
#define page_order_unsafe(page) ACCESS_ONCE(page_private(page))
|
||||
#define page_order_unsafe(page) READ_ONCE(page_private(page))
|
||||
|
||||
static inline bool is_cow_mapping(vm_flags_t flags)
|
||||
{
|
||||
|
Reference in New Issue
Block a user