summaryrefslogtreecommitdiffstats
path: root/arch/um/kernel
diff options
context:
space:
mode:
authorAnton Ivanov <anton.ivanov@cambridgegreys.com>2018-12-05 13:37:40 +0100
committerRichard Weinberger <richard@nod.at>2018-12-27 22:48:34 +0100
commit38e3cbd9b82c815006c505ad2995013a61af143e (patch)
tree0967a480864b5611fe931dd6ea090d272e241013 /arch/um/kernel
parentum: Optimize TLB operations v2 (diff)
downloadlinux-38e3cbd9b82c815006c505ad2995013a61af143e.tar.xz
linux-38e3cbd9b82c815006c505ad2995013a61af143e.zip
um: Skip TLB flushing where not needed
Skip TLB flushing for all cases where it is not needed, not just flush_tlb_mm_range Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r--arch/um/kernel/tlb.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index b7f7a60a0928..9ca902df243a 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -520,6 +520,13 @@ pte_t *addr_pte(struct task_struct *task, unsigned long addr)
void flush_tlb_all(void)
{
+ /*
+ * Don't bother flushing if this address space is about to be
+ * destroyed.
+ */
+ if (atomic_read(&current->mm->mm_users) == 0)
+ return;
+
flush_tlb_mm(current->mm);
}
@@ -541,6 +548,13 @@ void __flush_tlb_one(unsigned long addr)
static void fix_range(struct mm_struct *mm, unsigned long start_addr,
unsigned long end_addr, int force)
{
+ /*
+ * Don't bother flushing if this address space is about to be
+ * destroyed.
+ */
+ if (atomic_read(&mm->mm_users) == 0)
+ return;
+
fix_range_common(mm, start_addr, end_addr, force);
}
@@ -556,13 +570,6 @@ EXPORT_SYMBOL(flush_tlb_range);
void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
unsigned long end)
{
- /*
- * Don't bother flushing if this address space is about to be
- * destroyed.
- */
- if (atomic_read(&mm->mm_users) == 0)
- return;
-
fix_range(mm, start, end, 0);
}