* [PATCH] MIPS: Keep TLB cache hot while flushing
@ 2011-10-28 14:15 Hillf Danton
2011-10-28 16:16 ` David Daney
0 siblings, 1 reply; 4+ messages in thread
From: Hillf Danton @ 2011-10-28 14:15 UTC (permalink / raw)
To: David Daney; +Cc: Ralf Baechle, linux-mips
Hi David,
If we only flush the TLB of the given huge page, the TLB cache remains hot for
the relevant mm as it is, and less will be refilled after flush, huge or not.
As always all comments and ideas welcome.
Thanks
Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
--- a/arch/mips/include/asm/hugetlb.h Sat May 14 15:21:01 2011
+++ b/arch/mips/include/asm/hugetlb.h Fri Oct 28 22:08:05 2011
@@ -70,7 +70,7 @@ static inline pte_t huge_ptep_get_and_cl
static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep)
{
- flush_tlb_mm(vma->vm_mm);
+ flush_tlb_page(vma, addr & huge_page_mask(hstate_vma(vma)));
}
static inline int huge_pte_none(pte_t pte)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Keep TLB cache hot while flushing
2011-10-28 14:15 [PATCH] MIPS: Keep TLB cache hot while flushing Hillf Danton
@ 2011-10-28 16:16 ` David Daney
2011-11-04 14:56 ` Ralf Baechle
0 siblings, 1 reply; 4+ messages in thread
From: David Daney @ 2011-10-28 16:16 UTC (permalink / raw)
To: Hillf Danton; +Cc: Ralf Baechle, linux-mips@linux-mips.org
On 10/28/2011 07:15 AM, Hillf Danton wrote:
> Hi David,
>
> If we only flush the TLB of the given huge page, the TLB cache remains hot for
> the relevant mm as it is, and less will be refilled after flush, huge or not.
>
> As always all comments and ideas welcome.
>
I haven't tested it, but it looks correct. When I wrote the original
flush_tlb_mm(), I was in a hurry and was more concerned about
maintaining TLB consistency, rather than performance.
> Thanks
>
> Signed-off-by: Hillf Danton<dhillf@gmail.com>
Acked-by: David Daney <david.daney@cavium.com>
> ---
>
> --- a/arch/mips/include/asm/hugetlb.h Sat May 14 15:21:01 2011
> +++ b/arch/mips/include/asm/hugetlb.h Fri Oct 28 22:08:05 2011
> @@ -70,7 +70,7 @@ static inline pte_t huge_ptep_get_and_cl
> static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
> unsigned long addr, pte_t *ptep)
> {
> - flush_tlb_mm(vma->vm_mm);
> + flush_tlb_page(vma, addr& huge_page_mask(hstate_vma(vma)));
> }
>
> static inline int huge_pte_none(pte_t pte)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Keep TLB cache hot while flushing
2011-10-28 16:16 ` David Daney
@ 2011-11-04 14:56 ` Ralf Baechle
2011-11-06 5:08 ` Hillf Danton
0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2011-11-04 14:56 UTC (permalink / raw)
To: David Daney; +Cc: Hillf Danton, linux-mips
On Fri, Oct 28, 2011 at 09:16:29AM -0700, David Daney wrote:
> >If we only flush the TLB of the given huge page, the TLB cache remains hot for
> >the relevant mm as it is, and less will be refilled after flush, huge or not.
> >
> >As always all comments and ideas welcome.
> >
>
> I haven't tested it, but it looks correct. When I wrote the
> original flush_tlb_mm(), I was in a hurry and was more concerned
> about maintaining TLB consistency, rather than performance.
Yes, looks sane and like an obvious performance improvment. but as always
with TLB stuff I'm paranoid so I've applied this to my 3.3 queue for it to
be tested well.
Hillf, do you have any benchmark numbers for this?
Thanks folks!
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Keep TLB cache hot while flushing
2011-11-04 14:56 ` Ralf Baechle
@ 2011-11-06 5:08 ` Hillf Danton
0 siblings, 0 replies; 4+ messages in thread
From: Hillf Danton @ 2011-11-06 5:08 UTC (permalink / raw)
To: Ralf Baechle; +Cc: David Daney, linux-mips
On Fri, Nov 4, 2011 at 10:56 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Fri, Oct 28, 2011 at 09:16:29AM -0700, David Daney wrote:
>
>> >If we only flush the TLB of the given huge page, the TLB cache remains hot for
>> >the relevant mm as it is, and less will be refilled after flush, huge or not.
>> >
>> >As always all comments and ideas welcome.
>> >
>>
>> I haven't tested it, but it looks correct. When I wrote the
>> original flush_tlb_mm(), I was in a hurry and was more concerned
>> about maintaining TLB consistency, rather than performance.
>
> Yes, looks sane and like an obvious performance improvment. but as always
> with TLB stuff I'm paranoid so I've applied this to my 3.3 queue for it to
> be tested well.
>
Thanks Ralf and David:)
> Hillf, do you have any benchmark numbers for this?
>
Simple application related to libhugetlbfs works as it was after this patch
applied. Unlike x86, MIPS box is rare resource, and I have to ask David, the
author of MIPS huge TLB, to benchmark this patch, and to test GUP on Cavium
chips as well.
Btw, the patch for THP is prepared, and I am chasing box for test. Would you
please, David, take a look at it before posting?
Thanks
Hillf
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-06 5:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-28 14:15 [PATCH] MIPS: Keep TLB cache hot while flushing Hillf Danton
2011-10-28 16:16 ` David Daney
2011-11-04 14:56 ` Ralf Baechle
2011-11-06 5:08 ` Hillf Danton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.