mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: David Miller <davem@davemloft.net>
Cc: rmk+lkml@arm.linux.org.uk, miklos@szeredi.hu,
	arjan@infradead.org, torvalds@osdl.org,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	akpm@osdl.org
Subject: Re: fuse, get_user_pages, flush_anon_page, aliasing caches and all that again
Date: Tue, 02 Jan 2007 17:34:18 -0600	[thread overview]
Message-ID: <1167780858.3687.13.camel@mulgrave.il.steeleye.com> (raw)
In-Reply-To: <20070102.151906.21595863.davem@davemloft.net>

On Tue, 2007-01-02 at 15:19 -0800, David Miller wrote:
> From: James Bottomley <James.Bottomley@SteelEye.com>
> Date: Tue, 02 Jan 2007 16:53:23 -0600
> 
> > OK, so lets get down to brass tacks and look at the API characteristics.
> > 
> > Some of the issues are:
> > 
> >      1. Should kmap() actually flush all the user spaces? 
> >      2. Do we need additional hints in to kmap/kunmap?
> > 
> > My initial thought on 1. is no, since by and large we use kmap on pages
> > that have come to use via an I/O path, so usually they've already had
> > the user caches made coherent, unless you want do do this via a hint.
> 
> Who did this cache flush?  The idea is to make flush_dcache_page()
> do nothing, and have all of the work be done via the kmap()/kunmap()
> sequence.

Erm ... for a device driver, if we're preparing to do I/O on the page
something must have made the user caches coherent ... that can't be
kmap, because the driver might elect to DMA on the page ... unless
another component of this API is going to be to make dma_map_... also
flush the user cache?

> The case you're speaking about isn't a fault path, so it's not
> like there will be a flush_cache_page() call somewhere either.

well ... currently the pages come down to fuse via get_user_pages()
which does have a flush_dcache_page() as part of its operation.

> > For 2. like I said, I coded this on parisc without hints (using the page
> > table information instead to deduce what type of access the page had
> > taken) but we could equally well have used hints.
> 
> There are two important attributes 1) most permissive page protection
> of the user mappings, essentially does anyone have a writable access
> to the page and 2) the access the kernel will make, read or write.
> 
> If the kernel is going to read, kmap() would need to flush any
> writable user mappings, that's all.

Agreed.

> If the kernel is going to write, all user mappings have to be
> purged completely so that the writes are visible.

Agreed.

> I'm going to coneniently remind you it's possible to avoid all of the
> cache flushes by using TLB mappings at kmap() time.  I think PARISC
> can even do this, to be honest.  What makes that scheme unusable on
> PARISC?

You mean to map congruently for the page using something like our
temporary cache alias scheme?  Yes ... it should be possible for the
short lived kmap_atomic() type maps ... it will be a bit harder for the
non-atomic longer lived maps ... but I think we're deprecating those.

James



  reply	other threads:[~2007-01-02 23:34 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21 15:26 Russell King
2006-12-21 15:53 ` Miklos Szeredi
2006-12-21 16:57   ` Russell King
2006-12-21 17:51     ` Miklos Szeredi
2006-12-21 21:04       ` Jan Engelhardt
2006-12-21 21:30         ` Miklos Szeredi
2007-01-01 15:04     ` James Bottomley
2006-12-21 17:17   ` Russell King
2006-12-21 17:55     ` Miklos Szeredi
2006-12-21 18:11       ` Russell King
2006-12-21 18:30         ` Miklos Szeredi
2006-12-21 18:55           ` Russell King
2006-12-21 19:05             ` Miklos Szeredi
2006-12-21 23:51               ` Randolph Chung
2006-12-22  8:43                 ` Russell King
2006-12-22 14:45                   ` Randolph Chung
2006-12-30 16:39     ` Russell King
2006-12-30 16:50       ` Russell King
2006-12-30 18:26         ` Linus Torvalds
2006-12-30 22:46           ` Russell King
2006-12-31  5:23             ` David Miller
2006-12-31  9:10               ` Miklos Szeredi
2006-12-31  9:45                 ` David Miller
2006-12-31  9:23               ` Russell King
2006-12-31  9:27                 ` Arjan van de Ven
2006-12-31  9:47                   ` David Miller
2006-12-31 10:00                     ` Russell King
2006-12-31 10:04                       ` David Miller
2006-12-31 12:24                       ` Miklos Szeredi
2006-12-31 17:37                         ` Russell King
2007-01-01 22:15                           ` Miklos Szeredi
2007-01-01 23:45                             ` Russell King
2007-01-02 19:40                               ` Dan Williams
2007-01-02 22:53                               ` James Bottomley
2007-01-02 23:19                                 ` David Miller
2007-01-02 23:34                                   ` James Bottomley [this message]
2007-01-03  0:20                                     ` David Miller
2007-01-03 14:16                                       ` Russell King
2007-01-03 15:00                                         ` James Bottomley
2007-01-03 15:09                                           ` Russell King
2007-01-07 16:09                                             ` James Bottomley
2007-01-07 16:30                                               ` Russell King
2006-12-31 20:40                         ` David Miller
2006-12-31 20:58                           ` Linus Torvalds
2006-12-31 21:12                             ` David Miller
2007-01-01 16:44                               ` James Bottomley
2007-01-01 23:04                                 ` David Miller
2007-01-01 23:23                                   ` James Bottomley
     [not found]                     ` <1167669252.5302.57.camel@mulgrave.il.steeleye.com>
2007-01-01 23:01                       ` David Miller
2007-01-01 23:17                         ` Russell King
2006-12-31  9:55                   ` Russell King
2006-12-31  9:46                 ` David Miller
2007-01-01 14:35           ` James Bottomley
2007-01-01 16:21             ` Russell King
2006-12-30 18:21       ` Linus Torvalds
2006-12-21 16:29 ` Arjan van de Ven
2006-12-21 17:35   ` Russell King

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=1167780858.3687.13.camel@mulgrave.il.steeleye.com \
    --to=james.bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=davem@davemloft.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®