* [RFC][PATCH] powerpc/mm: convert tlbie to tlbiel when no batch is active
@ 2017-04-13 5:16 Balbir Singh
2017-04-17 7:07 ` Aneesh Kumar K.V
0 siblings, 1 reply; 2+ messages in thread
From: Balbir Singh @ 2017-04-13 5:16 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev, Balbir Singh
Do the checks that __flush_tlb_pending() does and check if
a local flush will do when batch->active is false inside of
hpte_need_flush(). I've checked the changes with tlbie tracing,
I see local flushes as applicable now and I've also run
some basic ltp testcases on top of these changes on a powernv
machine.
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
arch/powerpc/mm/tlb_hash64.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index 4517aa4..1268e3a 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -93,12 +93,17 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
/*
* Check if we have an active batch on this CPU. If not, just
- * flush now and return. For now, we don global invalidates
- * in that case, might be worth testing the mm cpu mask though
- * and decide to use local invalidates instead...
+ * flush now and return.
*/
if (!batch->active) {
- flush_hash_page(vpn, rpte, psize, ssize, 0);
+ const struct cpumask *tmp;
+ int local = 0;
+
+ tmp = cpumask_of(smp_processor_id());
+ if (cpumask_equal(mm_cpumask(mm), tmp))
+ local = 1;
+
+ flush_hash_page(vpn, rpte, psize, ssize, local);
put_cpu_var(ppc64_tlb_batch);
return;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC][PATCH] powerpc/mm: convert tlbie to tlbiel when no batch is active
2017-04-13 5:16 [RFC][PATCH] powerpc/mm: convert tlbie to tlbiel when no batch is active Balbir Singh
@ 2017-04-17 7:07 ` Aneesh Kumar K.V
0 siblings, 0 replies; 2+ messages in thread
From: Aneesh Kumar K.V @ 2017-04-17 7:07 UTC (permalink / raw)
To: Balbir Singh, benh, paulus, mpe; +Cc: linuxppc-dev
Balbir Singh <bsingharora@gmail.com> writes:
> Do the checks that __flush_tlb_pending() does and check if
> a local flush will do when batch->active is false inside of
> hpte_need_flush(). I've checked the changes with tlbie tracing,
> I see local flushes as applicable now and I've also run
> some basic ltp testcases on top of these changes on a powernv
> machine.
>
> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
> ---
> arch/powerpc/mm/tlb_hash64.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
> index 4517aa4..1268e3a 100644
> --- a/arch/powerpc/mm/tlb_hash64.c
> +++ b/arch/powerpc/mm/tlb_hash64.c
> @@ -93,12 +93,17 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
>
> /*
> * Check if we have an active batch on this CPU. If not, just
> - * flush now and return. For now, we don global invalidates
> - * in that case, might be worth testing the mm cpu mask though
> - * and decide to use local invalidates instead...
> + * flush now and return.
> */
> if (!batch->active) {
> - flush_hash_page(vpn, rpte, psize, ssize, 0);
> + const struct cpumask *tmp;
> + int local = 0;
> +
> + tmp = cpumask_of(smp_processor_id());
> + if (cpumask_equal(mm_cpumask(mm), tmp))
> + local = 1;
> +
> + flush_hash_page(vpn, rpte, psize, ssize, local);
Can you use mm_is_thread_local(). Also switch similar open coded paths
when doing that ?
> put_cpu_var(ppc64_tlb_batch);
> return;
> }
> --
> 2.9.3
-aneesh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-17 7:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-13 5:16 [RFC][PATCH] powerpc/mm: convert tlbie to tlbiel when no batch is active Balbir Singh
2017-04-17 7:07 ` Aneesh Kumar K.V
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).