From: Shane McDonald <mcdonald.shane@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: figo zhang <figo1802@gmail.com>, linux-mips@linux-mips.org
Subject: Re: how i can know the linux-mips implememt cache strategy?
Date: Sat, 21 Nov 2009 09:18:26 -0600 [thread overview]
Message-ID: <b2b2f2320911210718j5909c151s3286f715d0ab39db@mail.gmail.com> (raw)
In-Reply-To: <20091118114432.GA17418@linux-mips.org>
On Wed, Nov 18, 2009 at 5:44 AM, Ralf Baechle <ralf@linux-mips.org> wrote:
>
> The kernel will always use cache stategy 3 for non-coherent systems and
> caching strategy 5 for cache coherent systems. These two select the most
> aggressive caching strategy on all processors and that's what gives the
> best performance.
OK, dumb question -- how is this implemented? Poking through the code,
it looks to me that the cache strategy used comes from the K0 field of the
coprocessor 0 Config register, which I think is whatever gets set up by
the bootloader, or if that wasn't done, the default value of that
field for the processor.
See function coherency_setup() in arch/mips/mm/c-r4k.c:
if (cca < 0 || cca > 7)
cca = read_c0_config() & CONF_CM_CMASK;
_page_cachable_default = cca << _CACHE_SHIFT;
This can be overridden on the kernel command line with the "cca" parameter,
but as Ralf said in
http://www.linux-mips.org/archives/linux-mips/2008-06/msg00186.html,
"passing a CCA value on the command line is nothing a user should
ever, ever have to do".
I can see how this was implemented in 2.6.25, but commit 3513369
[MIPS] Allow setting of the cache attribute at run time, seems to have changed
from the behaviour Ralf described.
Shane
next prev parent reply other threads:[~2009-11-21 15:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-18 2:59 how i can know the linux-mips implememt cache strategy? figo zhang
2009-11-18 11:44 ` Ralf Baechle
2009-11-21 15:18 ` Shane McDonald [this message]
2009-11-21 23:31 ` 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=b2b2f2320911210718j5909c151s3286f715d0ab39db@mail.gmail.com \
--to=mcdonald.shane@gmail.com \
--cc=figo1802@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/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