linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: "David S. Miller" <davem@redhat.com>
Cc: mika.penttila@kolumbus.fi, <rmk@arm.linux.org.uk>,
	Andrew Morton <akpm@digeo.com>, <hugh@veritas.com>,
	<LW@karo-electronics.de>, <linux-kernel@vger.kernel.org>
Subject: Re: [patch] cache flush bug in mm/filemap.c (all kernels >= 2.5.30(at least))
Date: Tue, 27 May 2003 12:53:12 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0305270111370.5042-100000@serv> (raw)
In-Reply-To: <20030526.153415.41663121.davem@redhat.com>

Hi,

On Mon, 26 May 2003, David S. Miller wrote:

>    I'd prefer not to do this at driver level at all and rather let the
>    user of the data do it.
> 
> This is an easy thing to say, but you have to recognize that PIO
> based data transfers must retain the EXACT behavior required of
> real DMA transfers, which is that a subsequent user mapping of the
> data must be able to see the data without an intervening
> flush_dcache_page() or similar.
> 
> You can STILL optimize this the way you seem to want to.  The
> update_mmu_cache() routing exists as a point at which you can
> do such deferred situation-based flushing optimizations.
> 
> F.e. at ide_insw() time you mark pages as "might_need_flush" with
> some bit in page->flags, we even have bits allocated for arch specific
> use and we can allocate 1 or 2 more if you need them.  Then at
> update_mmu_cache() time you check this bit and act accordingly.

I thought about this before, but I don't think there is much to optimize. 
The PG_arch_1 bit is the only optimization which makes sense and setting 
it by default to dirty, makes it a lot easier for PIO drivers. PIO 
transfers are really the smallest problem as drivers write only into not 
uptodate and so not mapped pages. We have to be more careful with other 
writes, that they always call flush_dcache_page().
The point I don't like about update_mmu_cache() is that it's called 
_after_ set_pte(). Practically it's maybe not a problem right now, but 
the cache synchronization should happen before set_pte().

bye, Roman


  reply	other threads:[~2003-05-27 10:40 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-22 12:34 [patch] cache flush bug in mm/filemap.c (all kernels >= 2.5.30(at least)) LW
2003-05-22 14:03 ` Russell King
2003-05-22 14:11 ` Russell King
2003-05-23  8:02   ` David S. Miller
2003-05-23  9:12     ` Andrew Morton
2003-05-23  9:49       ` David S. Miller
2003-05-23 10:04         ` Andrew Morton
2003-05-23 10:15           ` David S. Miller
2003-05-23  8:20   ` Lothar Wassmann
2003-05-23  9:24     ` Andrew Morton
2003-05-23 10:04       ` Lothar Wassmann
2003-05-23 10:45         ` Andrew Morton
2003-05-23 11:22           ` Paul Mackerras
2003-05-23 16:54           ` Russell King
2003-05-23 17:31             ` Hugh Dickins
2003-05-23 18:29               ` Andrew Morton
2003-05-23 18:34                 ` Russell King
2003-05-26  3:19                   ` David S. Miller
2003-05-26  5:07                     ` Mika Penttilä
2003-05-26  5:08                       ` David S. Miller
2003-05-26  5:36                         ` Mika Penttilä
2003-05-26  5:36                           ` David S. Miller
2003-05-26 13:18                             ` Roman Zippel
2003-05-26 22:34                               ` David S. Miller
2003-05-27 10:53                                 ` Roman Zippel [this message]
2003-05-27 21:22                                   ` David S. Miller
2003-05-28 16:35                                     ` Roman Zippel
2003-05-28 22:47                                       ` David S. Miller
2003-05-29  0:12                                         ` Roman Zippel
2003-05-29  1:37                                           ` David S. Miller
2003-05-29  7:13                                             ` Russell King
2003-05-29  7:15                                               ` David S. Miller
2003-05-29 17:49                                             ` Roman Zippel
2003-05-29 21:09                                               ` David S. Miller
2003-05-26  8:55                     ` Russell King
2003-05-26 13:08                       ` Lothar Wassmann
2003-05-26 22:19                         ` Russell King
2003-05-26 13:25                       ` Jens Axboe
2003-05-26 22:35                       ` David S. Miller
2003-05-26  3:20                   ` David S. Miller
2003-05-23 11:13         ` Russell King
2003-05-23 12:46           ` Lothar Wassmann
2003-05-23 15:42             ` Hugh Dickins
2003-05-25 17:10               ` David Woodhouse
2003-05-26 11:44               ` Lothar Wassmann

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=Pine.LNX.4.44.0305270111370.5042-100000@serv \
    --to=zippel@linux-m68k.org \
    --cc=LW@karo-electronics.de \
    --cc=akpm@digeo.com \
    --cc=davem@redhat.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.penttila@kolumbus.fi \
    --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).