linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: MinChan Kim <minchan.kim@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, npiggin@suse.de,
	akpm@linux-foundation.org
Subject: Re: [PATCH] Remove needless flush_dcache_page call
Date: Thu, 15 Jan 2009 22:33:38 -0700	[thread overview]
Message-ID: <20090116053338.GC31013@parisc-linux.org> (raw)
In-Reply-To: <20090116052804.GA18737@barrios-desktop>

On Fri, Jan 16, 2009 at 02:28:04PM +0900, MinChan Kim wrote:
> Now, Anyone don't maintain cramfs.
> I don't know who is maintain romfs. so I send this patch to linux-mm, 
> lkml, linux-dev. 
> 
> I am not sure my thought is right. 
> 
> When readpage is called, page with argument in readpage is just new 
> allocated because kernel can't find that page in page cache. 
> 
> At this time, any user process can't map the page to their address space. 
> so, I think D-cache aliasing probelm never occur. 
> 
> It make sense ?

Sorry, no.  You have to call fluch_dcache_page() in two situations --
when the kernel is going to read some data that userspace wrote, *and*
when userspace is going to read some data that the kernel wrote.  From a
quick look at the patch, this seems to be the second case.  The kernel
wrote data to a pagecache page, and userspace should be able to read it.

To understand why this is necessary, consider a processor which is
virtually indexed and has a writeback cache.  The kernel writes to a
page, then a user process reads from the same page through a different
address.  The cache doesn't find the data the kernel wrote because it
has a different virtual index, so userspace reads stale data.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-01-16  5:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16  5:28 [PATCH] Remove needless flush_dcache_page call MinChan Kim
2009-01-16  5:33 ` Matthew Wilcox [this message]
2009-01-16  5:51   ` MinChan Kim
2009-01-16  5:57     ` Matthew Wilcox
2009-01-16  6:08       ` MinChan Kim
2009-01-16  6:13         ` Nick Piggin
2009-01-16  6:16           ` MinChan Kim
2009-01-16  5:59     ` Nick Piggin
2009-01-16  6:01       ` Matthew Wilcox

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=20090116053338.GC31013@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan.kim@gmail.com \
    --cc=npiggin@suse.de \
    /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).