Linux SNPS ARC Archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Vineet Gupta <vgupta@kernel.org>
Cc: linux-snps-arc@lists.infradead.org,
	Alexey Brodkin <abrodkin@synopsys.com>
Subject: Re: How many colours does the ARC cache have?
Date: Sat, 18 Feb 2023 19:03:51 +0000	[thread overview]
Message-ID: <Y/EhF1W9V+coccd6@casper.infradead.org> (raw)
In-Reply-To: <4ebe9300-c694-5a49-7180-ca6c14ec11b6@kernel.org>

On Wed, Feb 15, 2023 at 08:59:18PM -0800, Vineet Gupta wrote:
> On 2/10/23 09:06, Matthew Wilcox wrote:
> > I see a discrepancy here ...
> > 
> > arch/arc/include/asm/shmparam.h:
> > /* Handle upto 2 cache bins */
> > #define SHMLBA  (2 * PAGE_SIZE)
> > 
> > arch/arc/include/asm/cacheflush.h:
> > #define CACHE_COLORS_NUM        4
> 
> The initial aliasing dcache support assumed 2 colors but was later bumped to
> 4, w/o making the adjustment in shmparam.h

OK.  Will you fix it yourself, or do you want me to send a patch?

> > (there are some other problems with the arc cache flushing code;
> 
> The VIPT aliasing config (which is pretty much dead and unused) or regular
> parts ?

I'm not sure.  This is incorrect in flush_dcache_page():

        } else if (page_mapcount(page)) {
[...]
                unsigned long vaddr = page->index << PAGE_SHIFT;

If the page being flushed is a tail page, then page->index is not
valid, so you're essentially flushing a random address.  I have a
fix for it that I sent out earlier this week.

> > I'm working on patches to address them, but those are things I understand a
> > little better.  I know nothing about the ARC architecture itself)
> 
> Legacy ARC700 cpus had VIPT D$. The cache size was configurable by Soc
> builder and the specific geometry could yield an aliasing configuration
> (e.g. standard page size 8K, 4 way set associative D$: so D$ > 32K were
> aliasing and needed CONFIG_ARC_CACHE_VIPT_ALIASING). Although there was ever
> only 1 customer who taped out an aliasing cache config.
> 
> The newer ARC HS cores have PIPT D$ and thus don't need the aliasing
> support.
> 
> FWIW we could rip out all the VIPT aliasing code as I don't think it is
> needed anymore. @Alexey can you confirm ?
> 
> -Vineet

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

      reply	other threads:[~2023-02-18 19:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 17:06 How many colours does the ARC cache have? Matthew Wilcox
2023-02-16  4:59 ` Vineet Gupta
2023-02-18 19:03   ` Matthew Wilcox [this message]

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=Y/EhF1W9V+coccd6@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=abrodkin@synopsys.com \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=vgupta@kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).