linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Dmitry Adamushko <dmitry.adamushko@gmail.com>,
	linux-fsdevel@vger.kernel.org, Naval Saini <navalnovel@gmail.com>,
	linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.arm.linux.org.uk,
	linux-kernel@vger.kernel.org, naval.saini@nxp.com,
	James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: O_DIRECT patch for processors with VIPT cache for mainline kernel (specifically arm in our case)
Date: Thu, 20 Nov 2008 19:30:49 +0000	[thread overview]
Message-ID: <20081120193049.GC14686@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20081120174054.GU1617@parisc-linux.org>

On Thu, Nov 20, 2008 at 10:40:54AM -0700, Matthew Wilcox wrote:
> On Thu, Nov 20, 2008 at 05:17:14PM +0000, Ralf Baechle wrote:
> > On Thu, Nov 20, 2008 at 08:27:19AM -0700, Matthew Wilcox wrote:
> > > I'm not quite sure why you need kmap_coherent().  If a page is mapped into
> > > userspace, you can find what address it's mapped to from
> > > page->mapping->i_mmap and page->index.  OTOH, that's potentially
> > 
> > Even if we know the userspace address of a page we do not necessarily have
> > a usable mapping for kernel purposes.  The userspace mapping might be r/o
> > when we need r/w or it might be in another process.  kmap_coherent takes
> > the job of creating a r/w mapping on a suitable kernel virtual address
> > that will avoid any aliases.
> 
> Ah, I didn't do a good enough job of explaining.  My question was why
> you needed the 'address' argument to kmap_coherent (and thus had a
> different prototype from kmap) instead of just implementing kmap() on
> mips.

Ok, having discussed this with Matthew, I'm beginning to really warm
to the idea of always kmapping page cache accesses.

That nicely means that we never touch the page cache via the kernel
direct mapping, which in turn means we can reduce the amount of RAM
mapped, freeing up space for kmap in the virtual address space.

I think this should work really nicely, and make flush_dcache_page()
almost a no-op for aliasing VIPT caches (on ARM, we still have a
problem with instruction/data cache aliasing, but that's a far easier
issue to solve.)

Ralf: were you saying that you already had an implementation similar
to Matthew's?  As I see it, if you use page->index to determine the
userspace mapping colouring (which we do on ARM) then kmap() already
has access the necessary information to correctly place the page...

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

  reply	other threads:[~2008-11-20 19:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d8dd82df0811180606w503563ach8650ab07dcd0a35c@mail.gmail.com>
     [not found] ` <200811191740.23638.nickpiggin@yahoo.com.au>
     [not found]   ` <20081119204315.GB17209@flint.arm.linux.org.uk>
2008-11-20  6:59     ` O_DIRECT patch for processors with VIPT cache for mainline kernel (specifically arm in our case) Nick Piggin
2008-11-20  9:19       ` Russell King - ARM Linux
2008-11-20 10:55         ` Naval Saini
2008-11-21 17:10         ` Catalin Marinas
2008-11-20 12:28       ` Dmitry Adamushko
2008-11-20 13:25         ` Nick Piggin
2008-11-20 13:55           ` Ralf Baechle
2008-11-20 15:27             ` Matthew Wilcox
2008-11-20 17:17               ` Ralf Baechle
2008-11-20 17:40                 ` Matthew Wilcox
2008-11-20 19:30                   ` Russell King - ARM Linux [this message]
2008-11-20 16:30             ` Russell King - ARM Linux
2008-11-20 13:59           ` Dmitry Adamushko

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=20081120193049.GC14686@flint.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=naval.saini@nxp.com \
    --cc=navalnovel@gmail.com \
    --cc=nickpiggin@yahoo.com.au \
    --cc=ralf@linux-mips.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;
as well as URLs for NNTP newsgroup(s).