public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: linux-arch@vger.kernel.org
Subject: Re: Potential problem with the page_mapping macro and flush_dcache_page()
Date: Sun, 19 Mar 2006 17:39:36 -0600	[thread overview]
Message-ID: <1142811577.3240.75.camel@mulgrave.il.steeleye.com> (raw)
In-Reply-To: <20060319.140124.69326977.davem@davemloft.net>

On Sun, 2006-03-19 at 14:01 -0800, David S. Miller wrote:
> I don't dispute how the parisc cache behaves, you know that better
> than me, but I do want to know what in the world does the size of the
> cache have to do with deciding whether to design the hardware to flush
> all the matching lines or not?

> It's a CAM lookup on bus snoop.  That can search all physical tags in
> one CAM cycle, which will thus set the invalid bit on all matching
> cache lines regardless of virtual index.

Well ... CAM designs are really only appropriate to highly associative
cache designs, which the parisc cache isn't.  I just mentioned the size
because the cache size divided by the page size and divided by the
associativity gives a significantly large number in the PA cache, which
is what makes implementing a CAM design for it hard (or actually not
realistic).

> How is a virtual address getting into this equation at all?  The IOMMU
> sits on some other bus agent such as the PCI controller, right?  So
> coherency transactions, even if translated by the IOMMU from a PCI bus
> virtual address to a physical main memory address, looks like a
> physical address cache transation to the cpu caches on a bus snoop.

as part of the IOMMU set up and tear down in dma_map/unmap_sg require
this thing called a coherence index for each page; we simply work it out
from the kernel virtual address.  This is basically just a disguised
virtual index of the cache, but it's required for each iotlb entry.
When the IOMMU participates in the coherence protocol, it places the
coherence index as well as the physical address on the bus so the CPUs
know which lines to flush.

> What am I missing?

Nothing; it's always irked me that we need all these extra coherence
protocols for the PA VIPT cache because it's so large with such low
associativity.  But it also makes us a good test case for the linux
API ...

James



  reply	other threads:[~2006-03-19 23:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-19 17:15 Potential problem with the page_mapping macro and flush_dcache_page() James Bottomley
2006-03-19 20:33 ` David S. Miller
2006-03-19 20:53   ` James Bottomley
2006-03-19 21:00     ` David S. Miller
2006-03-19 21:04       ` James Bottomley
2006-03-19 21:23         ` James Bottomley
2006-03-19 21:26           ` David S. Miller
2006-03-19 23:50             ` James Bottomley
2006-03-20  1:15               ` James Bottomley
2006-03-19 21:25         ` David S. Miller
2006-03-19 21:29           ` James Bottomley
2006-03-19 22:01             ` David S. Miller
2006-03-19 23:39               ` James Bottomley [this message]
2006-03-19 23:42                 ` David S. Miller
2006-03-23  6:20             ` Andrew Morton
2006-03-23 14:13               ` James Bottomley

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=1142811577.3240.75.camel@mulgrave.il.steeleye.com \
    --to=james.bottomley@steeleye.com \
    --cc=davem@davemloft.net \
    --cc=linux-arch@vger.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