On Sun, Apr 03, 2011 at 11:49:13AM +0800, wilbur.chan wrote:
> Hi all
> We have a system running on mips64 xlr 732. Our major application
> I'm totally exhausted about the tlb miss, I wonder if we can record
> the virtual region of tlb miss and the miss count in each region, in
> that way,
> I can find out which part leads to this tlb miss.That is , to record
> C0_BADVADDR in tlb miss.
> However I'm not sure how to add code in build_r4000_tlb_refill_handler
> function, for it is wrote in some strage way .
> Any suggestion on how to reduce tlb miss?
In our SDK linux, there is some code to add instructions in the TLB
exception handler using the cpu scratch registers to count TLB misses.
(see mips/mm/tlbex.c code generated with OS_SCRATCH_REG2)
You can extend it with another scratch register containing the an address
per cpu where to record TLB miss badvaddr values(you would just need to
add code to add sizeof(void*) to the scratch reg value and UASM_i_SW to
store addr). This should give you and idea which adresses are causing the
I have not actually tried this out on linux(but I have implemented similar
code on FreeBSD and vxWorks) so it should work, let me know if you are
able to get this going...