linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Hugh Dickins <hugh@veritas.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@osdl.org>,
	David Howells <dhowells@redhat.com>,
	Martin Bligh <mbligh@google.com>, Nick Piggin <npiggin@suse.de>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH] mm: tracking dirty pages -v6
Date: Thu, 8 Jun 2006 09:53:47 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606080938250.5695@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1149770654.4408.71.camel@lappy>

1. The case that a vma is shared is not likely.

2. Typo fix in mmap.c

3. This may be a bit controversial but it does not seem to
   make sense to use the update_mmu_cache macro when we reuse
   the page. We are only fiddling around with the protections,
   the dirty and accessed bits.

   With the call to update_mmu_cache the way of using the macros
   would be different from mprotect() and page_mkclean(). I'd
   rather have everything work the same way. If this breaks on some
   arches then also mprotect and page_mkclean() are broken.
   The use of mprotect() is rare, we may have breakage in some
   arches that we just have not seen yet.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6/mm/memory.c
===================================================================
--- linux-2.6.orig/mm/memory.c	2006-06-08 09:12:13.000000000 -0700
+++ linux-2.6/mm/memory.c	2006-06-08 09:50:17.000000000 -0700
@@ -1452,7 +1452,7 @@ static int do_wp_page(struct mm_struct *
 	if (!old_page)
 		goto gotten;
 
-	if (vma->vm_flags & VM_SHARED) {
+	if (unlikely(vma->vm_flags & VM_SHARED)) {
 		reuse = 1;
 		dirty_page = old_page;
 		get_page(dirty_page);
@@ -1466,7 +1466,6 @@ static int do_wp_page(struct mm_struct *
 		entry = pte_mkyoung(orig_pte);
 		entry = maybe_mkwrite(pte_mkdirty(entry), vma);
 		ptep_set_access_flags(vma, address, page_table, entry, 1);
-		update_mmu_cache(vma, address, entry);
 		lazy_mmu_prot_update(entry);
 		ret |= VM_FAULT_WRITE;
 		goto unlock;
Index: linux-2.6/mm/mmap.c
===================================================================
--- linux-2.6.orig/mm/mmap.c	2006-06-08 09:15:54.000000000 -0700
+++ linux-2.6/mm/mmap.c	2006-06-08 09:17:41.000000000 -0700
@@ -1092,7 +1092,7 @@ munmap_back:
 		 * f_op->mmap() - modifies vm_page_prot; but will not reset
 		 *                from vm_flags.
 		 *
-		 * Hence between the two calls (here) it is save to modify
+		 * Hence between the two calls (here) it is safe to modify
 		 * vm_page_prot depending on backing_dev_info capabilities.
 		 *
 		 * shmem_backing_dev_info does have BDI_CAP_NO_ACCT_DIRTY.

--
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-06-08 16:53 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
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 [this message]
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.0606080938250.5695@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@osdl.org \
    --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