From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V4] ARM: handle user space mapped pages in flush_kernel_dcache_page
Date: Wed, 29 May 2013 18:33:28 +0100 [thread overview]
Message-ID: <20130529173328.GS17767@MacBook-Pro.local> (raw)
In-Reply-To: <alpine.LFD.2.03.1305291230160.1918@syhkavp.arg>
On Wed, May 29, 2013 at 05:32:50PM +0100, Nicolas Pitre wrote:
> On Wed, 29 May 2013, Nicolas Pitre wrote:
>
> > On Wed, 29 May 2013, Catalin Marinas wrote:
> >
> > > On Tue, May 28, 2013 at 06:52:27PM +0100, Nicolas Pitre wrote:
> > > > On Tue, 28 May 2013, Catalin Marinas wrote:
> > > >
> > > > > On Sat, May 25, 2013 at 04:53:19AM +0100, Nicolas Pitre wrote:
> > > > > > On Thu, 23 May 2013, Catalin Marinas wrote:
> > > > > >
> > > > > > > An issue is that for kunmap_atomic() && VIVT we flush the same page
> > > > > > > twice. I don't think we should remove the cache flushing in
> > > > > > > __kunmap_atomic() for VIVT since not all kunmap_atomic() calls require
> > > > > > > flush_kernel_dcache_page() (unless we just assume that highmem && vivt
> > > > > > > don't work together).
> > > > > >
> > > > > > VIVT and highmem do work together. Highmem for ARM was in fact
> > > > > > developed on such a platform.
> > > > >
> > > > > Thanks for confirming. Do you remember why kunmap() doesn't (need to)
> > > > > flush the cache alias (for VIVT)? Or if it does, where?
> > > >
> > > > kunmap() calls kunmap_high() which actually does not unmap anything but
> > > > only decrement a use count. The page is kept around in case it is
> > > > kmap()'d again, in which case the kmap() will be almost free and the
> > > > page still warm.
> > > >
> > > > It is only when the kmap() for a new page runs out of free pkmap
> > > > entries that the unused but still mapped pages are unmapped. This
> > > > unmapping is done in flush_all_zero_pkmaps() where all the unused pages
> > > > are all unmapped at once. The cache for all those pages is flushed with
> > > > flush_cache_kmaps() which on ARM maps to flush_cache_all() when the
> > > > cache is VIVT.
> > >
> > > Thanks for clarification Nico. So if kmap_high_get() returns NULL, there
> > > are no high aliases left in the cache.
> >
> > Exact.
>
> Just to be clear, this is true for VIVT only.
> Unmapped highmem pages can still be cached with VIPT.
Indeed.
--
Catalin
next prev parent reply other threads:[~2013-05-29 17:33 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-12 5:35 [PATCH V4] ARM: handle user space mapped pages in flush_kernel_dcache_page Simon Baatz
2013-05-23 10:43 ` Catalin Marinas
2013-05-25 3:53 ` Nicolas Pitre
2013-05-28 9:55 ` Catalin Marinas
2013-05-28 17:52 ` Nicolas Pitre
2013-05-29 10:37 ` Catalin Marinas
2013-05-29 14:39 ` Nicolas Pitre
2013-05-29 16:32 ` Nicolas Pitre
2013-05-29 17:33 ` Catalin Marinas [this message]
2013-05-27 21:42 ` Simon Baatz
2013-05-28 10:20 ` Catalin Marinas
2013-05-28 18:50 ` Nicolas Pitre
2013-05-29 11:05 ` Catalin Marinas
2013-05-29 19:16 ` Simon Baatz
2013-05-30 16:43 ` Catalin Marinas
2013-05-31 12:05 ` Jason Cooper
2013-05-31 14:15 ` Catalin Marinas
2013-05-31 14:20 ` Jason Cooper
2013-06-03 17:38 ` Simon Baatz
2013-06-03 18:03 ` Jason Cooper
2013-06-03 19:11 ` Simon Baatz
2013-06-03 19:22 ` Jason Cooper
2013-06-03 20:38 ` Greg KH
2013-06-05 13:58 ` Catalin Marinas
2013-06-05 19:55 ` Simon Baatz
2013-05-31 9:07 ` Ming Lei
2013-05-31 18:54 ` Simon Baatz
2013-06-01 10:27 ` Ming Lei
2013-06-03 9:33 ` 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=20130529173328.GS17767@MacBook-Pro.local \
--to=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).