All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 5/5] Optimize page_mkclean_one
Date: Fri, 29 Jun 2007 15:55:35 +0200	[thread overview]
Message-ID: <20070629141528.511942868@de.ibm.com> (raw)
In-Reply-To: 20070629135530.912094590@de.ibm.com

[-- Attachment #1: 006-page-mkclean.diff --]
[-- Type: text/plain, Size: 1156 bytes --]

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

page_mkclean_one is used to clear the dirty bit and to set the write
protect bit of a pte. In additions it returns true if the pte either
has been dirty or if it has been writable. As far as I can see the
function should return true only if the pte has been dirty, or page
writeback will needlessly write a clean page.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 mm/rmap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -urpN linux-2.6/mm/rmap.c linux-2.6-patched/mm/rmap.c
--- linux-2.6/mm/rmap.c	2007-06-29 09:58:33.000000000 +0200
+++ linux-2.6-patched/mm/rmap.c	2007-06-29 15:44:58.000000000 +0200
@@ -433,11 +433,12 @@ static int page_mkclean_one(struct page 
 
 		flush_cache_page(vma, address, pte_pfn(*pte));
 		entry = ptep_clear_flush(vma, address, pte);
+		if (pte_dirty(entry))
+			ret = 1;
 		entry = pte_wrprotect(entry);
 		entry = pte_mkclean(entry);
 		set_pte_at(mm, address, pte, entry);
 		lazy_mmu_prot_update(entry);
-		ret = 1;
 	}
 
 	pte_unmap_unlock(pte, ptl);

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


WARNING: multiple messages have this Message-ID (diff)
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 5/5] Optimize page_mkclean_one
Date: Fri, 29 Jun 2007 15:55:35 +0200	[thread overview]
Message-ID: <20070629141528.511942868@de.ibm.com> (raw)
In-Reply-To: 20070629135530.912094590@de.ibm.com

[-- Attachment #1: 006-page-mkclean.diff --]
[-- Type: text/plain, Size: 1330 bytes --]

page_mkclean_one is used to clear the dirty bit and to set the write
protect bit of a pte. In additions it returns true if the pte either
has been dirty or if it has been writable. As far as I can see the
function should return true only if the pte has been dirty, or page
writeback will needlessly write a clean page.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 mm/rmap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -urpN linux-2.6/mm/rmap.c linux-2.6-patched/mm/rmap.c
--- linux-2.6/mm/rmap.c	2007-06-29 09:58:33.000000000 +0200
+++ linux-2.6-patched/mm/rmap.c	2007-06-29 15:44:58.000000000 +0200
@@ -433,11 +433,12 @@ static int page_mkclean_one(struct page 
 
 		flush_cache_page(vma, address, pte_pfn(*pte));
 		entry = ptep_clear_flush(vma, address, pte);
+		if (pte_dirty(entry))
+			ret = 1;
 		entry = pte_wrprotect(entry);
 		entry = pte_mkclean(entry);
 		set_pte_at(mm, address, pte, entry);
 		lazy_mmu_prot_update(entry);
-		ret = 1;
 	}
 
 	pte_unmap_unlock(pte, ptl);

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--
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:[~2007-06-29 14:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 13:55 [patch 0/5] Various mm improvements Martin Schwidefsky
2007-06-29 13:55 ` Martin Schwidefsky
2007-06-29 13:55 ` [patch 1/5] avoid tlb gather restarts Martin Schwidefsky
2007-06-29 13:55   ` Martin Schwidefsky, Martin Schwidefsky
2007-06-29 18:56   ` Hugh Dickins
2007-06-29 18:56     ` Hugh Dickins
2007-06-29 21:19     ` Martin Schwidefsky
2007-06-29 21:19       ` Martin Schwidefsky
2007-06-30 13:16       ` Hugh Dickins
2007-06-30 13:16         ` Hugh Dickins
2007-06-29 13:55 ` [patch 2/5] remove ptep_establish Martin Schwidefsky
2007-06-29 13:55   ` Martin Schwidefsky, Martin Schwidefsky
2007-06-29 13:55 ` [patch 3/5] remove ptep_test_and_clear_dirty and ptep_clear_flush_dirty Martin Schwidefsky
2007-06-29 13:55   ` Martin Schwidefsky, Martin Schwidefsky
2007-07-03  1:29   ` Zachary Amsden
2007-07-03  1:29     ` Zachary Amsden
2007-07-03  7:26     ` Martin Schwidefsky
2007-07-03  7:26       ` Martin Schwidefsky
2007-06-29 13:55 ` [patch 4/5] move mm_struct and vm_area_struct Martin Schwidefsky
2007-06-29 13:55   ` Martin Schwidefsky, Martin Schwidefsky
2007-06-29 13:55 ` Martin Schwidefsky [this message]
2007-06-29 13:55   ` [patch 5/5] Optimize page_mkclean_one Martin Schwidefsky, Martin Schwidefsky
2007-06-30 14:04   ` Hugh Dickins
2007-06-30 14:04     ` Hugh Dickins
2007-07-01  7:15     ` Martin Schwidefsky
2007-07-01  7:15       ` Martin Schwidefsky
2007-07-01  8:54       ` Hugh Dickins
2007-07-01  8:54         ` Hugh Dickins
2007-07-01 13:27         ` Peter Zijlstra
2007-07-01 13:27           ` Peter Zijlstra
2007-07-02  7:07           ` Martin Schwidefsky
2007-07-02  7:07             ` Martin Schwidefsky
2007-07-01 19:50         ` Martin Schwidefsky
2007-07-01 19:50           ` Martin Schwidefsky
2007-07-01 10:29   ` Miklos Szeredi
2007-07-01 10:29     ` Miklos Szeredi

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=20070629141528.511942868@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.