From c663d0c8150ca47a29fe2288709d43d296efe251 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 27 Dec 2019 10:02:48 +0100 Subject: [PATCH] x86/mm: drop redundant smp_wmb() from _put_final_page_type() get_page_light()'s use of cmpxchg() is a full barrier already anyway. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- xen/arch/x86/mm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index b48777cc19..cc0d71996c 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2571,6 +2571,8 @@ int get_page(struct page_info *page, struct domain *domain) * - it will not be called more than once without dropping the thus * acquired reference again. * Due to get_page() reserving one reference, this call cannot fail. + * + * Note that some callers rely on this being a full memory barrier. */ static void get_page_light(struct page_info *page) { @@ -2755,7 +2757,7 @@ static int _put_final_page_type(struct page_info *page, unsigned long type, else { BUG_ON(rc != -ERESTART); - smp_wmb(); + /* get_page_light() includes a full barrier. */ get_page_light(page); page->u.inuse.type_info |= PGT_partial; } -- 2.39.5