lkml.org 
[lkml]   [2019]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v7 15/16] xpfo, mm: Fix hang when booting with "xpfotlbflush"
Date
Kernel hangs when booted up with "xpfotlbflush" option. This is caused
by xpfo_kunmap() fliushing TLB while holding xpfo lock starving other
tasks waiting for the lock. This patch moves tlb flush outside of the
code holding xpfo lock.

Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
---
mm/xpfo.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mm/xpfo.c b/mm/xpfo.c
index 85079377c91d..79ffdba6af69 100644
--- a/mm/xpfo.c
+++ b/mm/xpfo.c
@@ -148,6 +148,8 @@ EXPORT_SYMBOL(xpfo_kmap);

void xpfo_kunmap(void *kaddr, struct page *page)
{
+ bool flush_tlb = false;
+
if (!static_branch_unlikely(&xpfo_inited))
return;

@@ -168,10 +170,13 @@ void xpfo_kunmap(void *kaddr, struct page *page)
if (atomic_read(&page->xpfo_mapcount) == 0) {
SetPageXpfoUnmapped(page);
set_kpte(kaddr, page, __pgprot(0));
- xpfo_cond_flush_kernel_tlb(page, 0);
+ flush_tlb = true;
}
spin_unlock(&page->xpfo_lock);
}
+
+ if (flush_tlb)
+ xpfo_cond_flush_kernel_tlb(page, 0);
}
EXPORT_SYMBOL(xpfo_kunmap);

--
2.17.1
\
 
 \ /
  Last update: 2019-01-10 22:11    [W:0.693 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site