From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: htejun@gmail.com, davem@redhat.com, axboe@suse.de,
bzolnier@gmail.com, james.steward@dynamicratings.com,
jgarzik@pobox.com, linux-kernel@vger.kernel.org,
mattjreimer@gmail.com, rmk+lkml@arm.linux.org.uk
Subject: Re: [PATCHSET] block: fix PIO cache coherency bug
Date: Mon, 20 Mar 2006 08:50:08 -0800 [thread overview]
Message-ID: <20060320085008.d13dd57e.rdunlap@xenotime.net> (raw)
In-Reply-To: <1142871172.3283.17.camel@mulgrave.il.steeleye.com>
On Mon, 20 Mar 2006 10:12:51 -0600 James Bottomley wrote:
> On Wed, 2006-02-22 at 17:27 +0900, Tejun Heo wrote:
> > \This thread has been dead for quite some time mainly because I didn't
> > know what to do. As it is a real outstanding bug bugging people and
> > Matt Reimer thankfully reminded me[1], I'm giving another shot at
> > resolving this.
> >
> > People seem to agree that it is the responsibility of the driver to
> > make sure read data gets to the page cache page (or whatever kernel
> > page). Only driver knows how and when.
> >
> > The objection raised by James Bottomley is that although syncing the
> > kernel page is the responsbility of the driver, syncing user page is
> > not; thus, use of flush_dcache_page() is excessive. James suggested
> > use of flush_kernel_dcache_page().
> >
> > I also asked similar question[2] on lkml and Russell replied that
> > depending on arch implementation it shouldn't be much of a problem[3].
> > Another thing to consider is that all other drivers which currently
> > manage cache coherency use flush_dcache_page().
> >
> > So, the questions are...
> >
> > q1. James, besides from the use of flush_dcache_page(), do you agree
> > with the block layer kmap/kunmap API?
> >
> > 2. Is flush_kernel_dcache_page() the correct one?
> >
> > Whether or not flush_kernel_dcache_page() is the one or not, I think
> > we should first go with flush_dcache_page() as that's what drivers
> > have been doing upto this point. Switching from flush_dcache_page()
> > to flush_kernel_dcache_page() is very easy and should be done in a
> > separate patch anyway. No?
> >
> > Another thing mind is that this problem is not limited block drivers.
> > All the codes that perform writes to kmap'ed pages take care of
> > synchronization themselves and the popular choice seems to be
> > flush_dcache_page().
> >
> > IMHO, kmap API should have a flag or something to tell it how the page
> > is being used such that kmap API can take care of synchronization like
> > dma mapping API does rather than scattering sync code all over the
> > kernel. And if that's the right thing to do, some of blk kmap
> > wrappers can/should be removed.
> >
> > What do you guys think?
>
> Here's my proposal to break this logjam.
>
> I'm proposing introducing a new memory coherency API:
>
> flush_kernel_dcache_page()
>
> Which would be tasked with bringing cache coherency back to the kernel's
> image of a user page after the kernel has modified it. On parisc this
> will be a simple flush through the kernel cache.
>
> I think on arm this should be implemented as
>
> __cpuc_flush_dcache_page(page_address(page))
>
> but you can implement this as flush_dcache_page() if you wish (I warn
> you now that you have the same flush_dcache_mmap_lock problem that we
> have on parisc, so if you do this, you'll return from
> flush_dcache_page() with interrupts enabled, but at least this will no
> longer be a parisc problem).
>
> If everyone's happy with this approach, I'll take it over to linux-arch.
why is that the right place for it?
---
~Randy
next prev parent reply other threads:[~2006-03-20 16:48 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-13 15:24 Tejun Heo
2006-01-13 15:24 ` [PATCH 3/8] block: convert bio kmap helpers to use blk_kmap helpers Tejun Heo
2006-01-13 15:24 ` [PATCH 2/8] block: implement blk kmap helpers Tejun Heo
2006-01-13 15:24 ` [PATCH 4/8] block: convert IDE to use blk_kmap helpers Tejun Heo
2006-02-14 19:07 ` Matt Reimer
2006-02-15 2:05 ` Tejun Heo
2006-02-16 18:01 ` Russell King
2006-02-16 18:10 ` Linus Torvalds
2006-02-16 19:02 ` Russell King
2006-01-13 15:24 ` [PATCH 5/8] block: convert libata " Tejun Heo
2006-01-13 15:24 ` [PATCH 1/8] highmem: include asm/kmap_types.h in linux/highmem.h Tejun Heo
2006-01-13 15:24 ` [PATCH 7/8] block: convert block/rd.c to use blk_kmap helpers Tejun Heo
2006-01-13 15:24 ` [PATCH 6/8] block: convert scsi " Tejun Heo
2006-01-13 15:24 ` [PATCH 8/8] block: convert md " Tejun Heo
2006-01-13 15:37 ` [PATCHSET] block: fix PIO cache coherency bug Jens Axboe
2006-01-13 15:47 ` Bartlomiej Zolnierkiewicz
2006-01-13 15:50 ` James Bottomley
2006-01-13 18:20 ` Russell King
2006-01-13 18:35 ` James Bottomley
2006-01-13 19:06 ` Russell King
2006-02-22 8:27 ` Tejun Heo
2006-03-02 18:46 ` James Bottomley
2006-03-02 20:30 ` Russell King
2006-03-02 20:43 ` James Bottomley
2006-03-02 20:57 ` Russell King
2006-03-02 20:44 ` Jens Axboe
2006-05-29 19:17 ` Nicolas Pitre
2006-05-30 11:19 ` Tejun Heo
2006-05-30 21:07 ` Guennadi Liakhovetski
2006-05-30 21:32 ` Nicolas Pitre
2006-05-31 0:57 ` David S. Miller
2006-03-02 20:40 ` Jens Axboe
2006-03-20 16:12 ` James Bottomley
2006-03-20 16:26 ` Tejun Heo
2006-03-20 16:33 ` James Bottomley
2006-03-20 16:40 ` Tejun Heo
2006-03-20 16:48 ` James Bottomley
2006-03-23 14:23 ` James Bottomley
2006-03-20 16:50 ` Randy.Dunlap [this message]
2006-03-20 16:52 ` James Bottomley
2006-01-13 22:02 ` Russell King
2006-01-13 22:38 ` James Bottomley
2006-01-13 22:43 ` David S. Miller
2006-01-14 4:58 ` James Bottomley
2006-01-17 15:00 ` Jeff Garzik
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=20060320085008.d13dd57e.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=James.Bottomley@SteelEye.com \
--cc=axboe@suse.de \
--cc=bzolnier@gmail.com \
--cc=davem@redhat.com \
--cc=htejun@gmail.com \
--cc=james.steward@dynamicratings.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mattjreimer@gmail.com \
--cc=rmk+lkml@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
all inboxes | Powered by JetHome®