mm/page_ref: use atomic_set_release in page_ref_unfreeze
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Thu, 5 Apr 2018 23:23:24 +0000 (16:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Apr 2018 04:36:25 +0000 (21:36 -0700)
page_ref_unfreeze() has exactly that semantic.  No functional changes:
just minus one barrier and proper handling of PPro errata.

Link: http://lkml.kernel.org/r/151844393004.210639.4672319312617954272.stgit@buzz
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/page_ref.h

index 760d74a0e9a977c507da9006d8e7cdf4584dc6bb..14d14beb1f7f1d493574cb064c668de4b2f5d107 100644 (file)
@@ -175,8 +175,7 @@ static inline void page_ref_unfreeze(struct page *page, int count)
        VM_BUG_ON_PAGE(page_count(page) != 0, page);
        VM_BUG_ON(count == 0);
 
-       smp_mb();
-       atomic_set(&page->_refcount, count);
+       atomic_set_release(&page->_refcount, count);
        if (page_ref_tracepoint_active(__tracepoint_page_ref_unfreeze))
                __page_ref_unfreeze(page, count);
 }