Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Jayachandran C." <jayachandranc@netlogicmicro.com>
To: "wilbur.chan" <wilbur512@gmail.com>
Cc: Linux MIPS Mailing List <linux-mips@linux-mips.org>
Subject: Re: System suffers frequent TLB miss
Date: Mon, 4 Apr 2011 23:12:14 +0530	[thread overview]
Message-ID: <20110404174213.GA30412@jayachandranc.netlogicmicro.com> (raw)
In-Reply-To: <BANLkTikpqk-UcFHHD6MGyZgv6LociaETtg@mail.gmail.com>

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
TLB miss.

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...

JC.

  parent reply	other threads:[~2011-04-04 17:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-03  3:49 System suffers frequent TLB miss wilbur.chan
2011-04-03  4:07 ` wilbur.chan
2011-04-04 17:42 ` Jayachandran C. [this message]
2011-04-05 12:21 ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110404174213.GA30412@jayachandranc.netlogicmicro.com \
    --to=jayachandranc@netlogicmicro.com \
    --cc=linux-mips@linux-mips.org \
    --cc=wilbur512@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox