From: Christoph Lameter <clameter@sgi.com>
To: David Howells <dhowells@redhat.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>,
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: Fri, 26 May 2006 08:39:33 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0605260825160.31609@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <24747.1148653985@warthog.cambridge.redhat.com>
On Fri, 26 May 2006, David Howells wrote:
> page_mkwrite() is called just before the _PTE_ is dirtied. Take do_wp_page()
> for example, set_page_dirty() is called after a lot of stuff, including some
> stuff that marks the PTE dirty... by which time it's too late as another
> thread sharing the page tables can come along and modify the page before the
> first thread calls set_page_dirty().
Since we are terminating the application with extreme prejudice on an
error (SIGBUS) it does not matter if another process has written to the
page in the meantime.
> And also as you pointed out, set_page_dirty() needs to be able to sleep.
> There are places where it's called still, even with Peter's patch, with the
> page table lock held - zap_pte_range() for example. In that particular case,
> dropping the lock for each PTE would be bad for performance.
zap_pte_range would only have to dirty anonymous pages. The pages of
shared mappings would already be dirty.
> Basically, you can look at it as page_mkwrite() is called upfront, and
> set_page_dirty() is called at the end.
The end is that the page is written back. I think we can still solve this
with set_page_dirty being called when a page is about to be dirtied or
was dirtied.
The page_mkwrite() method does not really allow the tracking of dirty
pages. It is a way to track the potentially dirty pages that is useful if
one is not able to track dirty pages. Moreover, unmapped dirtied pages do
not factor into that scheme probably because it was thought that they are
already sufficiently tracked by nr_dirty. However, having two methods
of accounting for dirty pages creates problems in correlating the number
of dirty pages. This is unnecessarily complex.
In order to consistently reach the goal of of tracking dirty pages we
have to deal with set_page_dirty(). In the first stage lets just
be satified with being able to throttle dirty pages by having an accurate
nr_dirty.
We can then avoid doing too many things on set_page_dirty so that we do
not have to sleep or return an error. Maybe add the support for errors
(SIGBUS) later. But then we should consistently check everytime we dirty a
page be it mapped or unmapped.
--
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>
next prev parent reply other threads:[~2006-05-26 15:39 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
2006-05-26 2:33 ` Christoph Lameter
2006-05-26 14:33 ` David Howells
2006-05-26 15:39 ` Christoph Lameter [this message]
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=Pine.LNX.4.64.0605260825160.31609@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@osdl.org \
--cc=christoph@lameter.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