linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Paul Mundt <lethal@linux-sh.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	benh@kernel.crashing.org, davem@davemloft.net,
	rmk@arm.linux.org.uk
Subject: Re: [RFC PATCH] Update the cachetlb.txt file WRT flush_dcache_page and update_mmu_cache
Date: Mon, 10 May 2010 09:40:08 -0500	[thread overview]
Message-ID: <1273502408.4424.4.camel@mulgrave.site> (raw)
In-Reply-To: <20100510102947.GA14278@linux-sh.org>

On Mon, 2010-05-10 at 19:29 +0900, Paul Mundt wrote:
> On Mon, May 10, 2010 at 11:16:47AM +0100, Catalin Marinas wrote:
> > In most situations, just doing flushing in set_pte_at() would suffice
> > and flush_dcache_page() can be ignored. There are two situations where I
> > still see flush_dcache_page() useful:
> > 
> >      1. SMP systems where the cache maintenance operations aren't
> >         automatically broadcast in hardware
> >      2. The kernel modifies a page cache page that is already mapped in
> >         user space
> > 
> > (1) can be worked around on some architectures (though not sure about
> > all of them).
> > 
> > Is (2) a valid scenario?
> > 
> get_user_pages() ?

Actually, no, not really.  get_user_pages() is preparing the pages for
DMA (so it pins and possibly flushes them to make the underlying
physical page in the page cache clean).  This means it gathers the
physical pages into a scatter gather list.  It actually assumes the
kernel *won't* be touching them (without using kmap), so it doesn't give
the pages an in-kernel mapping.

James

  reply	other threads:[~2010-05-10 14:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 13:24 [RFC PATCH] Update the cachetlb.txt file WRT flush_dcache_page and update_mmu_cache Catalin Marinas
2010-05-10  8:06 ` FUJITA Tomonori
2010-05-10 10:16   ` Catalin Marinas
2010-05-10 10:29     ` Paul Mundt
2010-05-10 14:40       ` James Bottomley [this message]
2010-05-10 14:40         ` James Bottomley
2010-05-10 11:55     ` Matthew Wilcox
2010-05-10 14:00       ` [RFC PATCH] Update the cachetlb.txt file WRT flush_dcache_pageand update_mmu_cache Catalin Marinas
2010-05-10 14:03         ` David Miller
2010-05-10 14:32           ` Catalin Marinas
2010-05-11 11:31     ` [RFC PATCH] Update the cachetlb.txt file WRT flush_dcache_page and update_mmu_cache FUJITA Tomonori
2010-05-11 17:22       ` 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=1273502408.4424.4.camel@mulgrave.site \
    --to=james.bottomley@hansenpartnership.com \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=lethal@linux-sh.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).