linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	James.Bottomley@HansenPartnership.com, benh@kernel.crashing.org,
	davem@davemloft.net, rmk@arm.linux.org.uk
Subject: Re: [RFC PATCH] Update the cachetlb.txt file WRT flush_dcache_page and update_mmu_cache
Date: Mon, 10 May 2010 11:16:47 +0100	[thread overview]
Message-ID: <1273486607.3023.37.camel@e102109-lin.cambridge.arm.com> (raw)
In-Reply-To: <20100510170616O.fujita.tomonori@lab.ntt.co.jp>

On Mon, 2010-05-10 at 09:06 +0100, FUJITA Tomonori wrote:
> On Fri, 07 May 2010 14:24:18 +0100
> Catalin Marinas <catalin.marinas@arm.com> wrote:
> > @@ -312,15 +324,15 @@ maps this page at its virtual address.
> >       This allows these interfaces to be implemented much more
> >       efficiently.  It allows one to "defer" (perhaps indefinitely)
> >       the actual flush if there are currently no user processes
> > -     mapping this page.  See sparc64's flush_dcache_page and
> > -     update_mmu_cache implementations for an example of how to go
> > +     mapping this page.  See IA-64's flush_dcache_page and
> > +     set_pte_at implementations for an example of how to go
> >       about doing this.
> 
> cachetlb.txt says that flush_dcache_page() is the API to solve the
> D-cache aliasing issue. Using IA64 as an example for the API here
> looks strange since IA64 (PIPT) doesn't have D-cache aliasing
> issue.

Once we fix the ARM implementation, we could use it as an example :). It
has processors with both D-cache aliasing and separate I/D caches.

> I don't think that just replacing sparc64 with IA64 helps much here
> since we still have the problem that the whole cache handling
> (architectures, subsystems, file systems) is inconsistent. I think
> that we need to agree on it first.

Yes, this need to be agreed and hopefully this thread is a starting
point for such discussion.

The main problem I encountered on ARM was I/D cache coherency on a PIPT
processor and IA-64 and PowerPC fixed it by combining
flush_dcache_page() with set_pte_at().

IMHO, the D-cache aliasing isn't that much different from the I/D cache
coherency. We can view the I-cache as yet another alias of the D-cache
which needs explicit flushing. As I said on a few occasions, including
this patch, the flush_dcache_page() isn't always called from PIO
drivers. Adding a PIO API didn't seem very popular as it requires a lot
of drivers to be modified.

In most situations, just doing flushing in set_pte_at() would suffice
and flush_dcache_page() can be ignored. There are two situations where I
still see flush_dcache_page() useful:

     1. SMP systems where the cache maintenance operations aren't
        automatically broadcast in hardware
     2. The kernel modifies a page cache page that is already mapped in
        user space

(1) can be worked around on some architectures (though not sure about
all of them).

Is (2) a valid scenario?

-- 
Catalin

  reply	other threads:[~2010-05-10 10:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 13:24 [RFC PATCH] Update the cachetlb.txt file WRT flush_dcache_page and update_mmu_cache Catalin Marinas
2010-05-10  8:06 ` FUJITA Tomonori
2010-05-10 10:16   ` Catalin Marinas [this message]
2010-05-10 10:29     ` Paul Mundt
2010-05-10 14:40       ` James Bottomley
2010-05-10 14:40         ` James Bottomley
2010-05-10 11:55     ` Matthew Wilcox
2010-05-10 14:00       ` [RFC PATCH] Update the cachetlb.txt file WRT flush_dcache_pageand update_mmu_cache Catalin Marinas
2010-05-10 14:03         ` David Miller
2010-05-10 14:32           ` Catalin Marinas
2010-05-11 11:31     ` [RFC PATCH] Update the cachetlb.txt file WRT flush_dcache_page and update_mmu_cache FUJITA Tomonori
2010-05-11 17:22       ` Catalin Marinas

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=1273486607.3023.37.camel@e102109-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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 NNTP newsgroup(s).