linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Jeff Anderson-Lee" <jonah@eecs.berkeley.edu>
To: 'Christoph Lameter' <clameter@sgi.com>
Cc: 'Peter Zijlstra' <a.p.zijlstra@chello.nl>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	'Hugh Dickins' <hugh@veritas.com>,
	'Andrew Morton' <akpm@osdl.org>,
	'David Howells' <dhowells@redhat.com>,
	'Christoph Lameter' <christoph@lameter.com>,
	'Martin Bligh' <mbligh@google.com>,
	'Nick Piggin' <npiggin@suse.de>,
	'Linus Torvalds' <torvalds@osdl.org>
Subject: Re: [PATCH 1/3] mm: tracking shared dirty pages
Date: Thu, 25 May 2006 19:28:36 -0700	[thread overview]
Message-ID: <000001c6806c$19403760$ce2a2080@eecs.berkeley.edu> (raw)
In-Reply-To: <Pine.LNX.4.64.0605250921300.23726@schroedinger.engr.sgi.com>

Christoph Lameter wrote:

> I am a bit confused about the need for Davids patch. set_page_dirty() is 
> already a notification that a page is to be dirtied. Why do we need it 
> twice? set_page_dirty could return an error code and the file system can 
> use the set_page_dirty() hook to get its notification. What we would need 
> to do is to make sure that set_page_dirty can sleep.

set_page_dirty() is actually called fairly late in the game by
zap_pte_range() and follow_page().  Thus, it is a notification that a page
HAS BEEN dirtied and needs a writeback.

What is needed (at least for log structured or copy-on-write filesystems) is
a function that is called during the page fault BEFORE the pte's writeable
bit is set so that the pages' mapping can either be unmapped or remapped. 
That prevents possible readers of the old (read-only) version of the page
from seeing any changes via the page map cache.  If the page was unmapped, a
second call is needed later to map it to a new set of blocks on the device. 
For a log structured filesystem it can makes sense to defer the remapping
until late in the game when the block is about to be queued for i/o, in case
it gets deleted before it is ever flushed from the page cache.

I looked at using set_page_dirty for the first of these hooks, but it comes
too late.  It might be OK for the second (remapping) hook though.

do_wp_page() is called by handle_pte_fault() in exactly the case where this
would apply: if write access is needed and !pte_write(entry).  This patch
appears to address the necessary issue in a way that set_page_dirty cannot.

Jeff Anderson-Lee

[I'm a little late in coming in on this thread, and not 100% familiar with
the latest kernels, so please pardon me if I'm not fully up to speed yet. 
I'm trying to catch up as quickly as I can though!]

--
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>

  parent reply	other threads:[~2006-05-26  2:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-25 13:55 [PATCH 0/3] mm: tracking dirty pages -v5 Peter Zijlstra
2006-05-25 13:55 ` [PATCH -1/3] mm: page_mkwrite Peter Zijlstra
2006-05-25 13:55 ` [PATCH 1/3] mm: tracking shared dirty pages Peter Zijlstra
2006-05-25 16:21   ` Christoph Lameter
2006-05-25 17:00     ` Peter Zijlstra
2006-05-25 17:03       ` Christoph Lameter
2006-05-25 16:27   ` Christoph Lameter
2006-05-25 17:03     ` Peter Zijlstra
2006-05-25 17:06       ` Christoph Lameter
2006-05-26  2:28     ` Jeff Anderson-Lee [this message]
2006-05-26  2:33       ` Christoph Lameter
2006-05-26 14:33   ` David Howells
2006-05-26 15:39     ` Christoph Lameter
2006-05-30  8:00     ` David Howells
2006-05-30 15:38       ` Christoph Lameter
2006-05-30 16:26       ` David Howells
2006-05-30 17:02         ` Christoph Lameter
2006-05-30 17:25           ` Hugh Dickins
2006-05-30 17:30             ` Christoph Lameter
2006-05-30 17:41               ` Hugh Dickins
2006-05-30 17:56         ` David Howells
2006-05-30 20:21           ` Christoph Lameter
2006-05-25 13:56 ` [PATCH 2/3] mm: balance " Peter Zijlstra
2006-05-25 13:56 ` [PATCH 3/3] mm: msync cleanup Peter Zijlstra
2006-06-06 20:06 ` [PATCH 0/3] mm: tracking dirty pages -v5 Hugh Dickins
2006-06-07 18:08   ` Peter Zijlstra
2006-06-08 12:44   ` [PATCH] mm: tracking dirty pages -v6 Peter Zijlstra
2006-06-08 13:02     ` Peter Zijlstra
2006-06-08 16:53     ` Christoph Lameter
2006-06-08 20:10     ` Nate Diller
2006-06-08 20:20       ` Linus Torvalds

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='000001c6806c$19403760$ce2a2080@eecs.berkeley.edu' \
    --to=jonah@eecs.berkeley.edu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@osdl.org \
    --cc=christoph@lameter.com \
    --cc=clameter@sgi.com \
    --cc=dhowells@redhat.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mbligh@google.com \
    --cc=npiggin@suse.de \
    --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