Thread (32 messages) 32 messages, 6 authors, 2007-05-23

Re: vm changes from linux-2.6.14 to linux-2.6.15

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-05-10 06:19:37
Also in: linux-mm, sparclinux

On Wed, 2 May 2007 00:08:31 +0100 (BST) Mark Fortescue [off-list ref] wrote:
quoted hunk ↗ jump to hunk
On Wed, 2 May 2007, Benjamin Herrenschmidt wrote:
quoted
quoted
I have attached a patch (so pine does not mangle it) for linux-2.6.20.9.
Is this what you had in mind?

For linux-2.6.21, more work will be needed as it has more code calling
ptep_set_access_flags.
I'm not 100% sure we need the 'update' argument... we can remove the
whole old_entry, pte_same, etc... and just have pte_set_access_flags()
read the old PTE and decide wether something needs to be changed or not.

Ben.
The attached patch works on sun4c (with my simple ADA compile test) but 
the change in functionality may break things other platforms.

The advantage of the previous patch is that the functionality is only 
changed for sparc sun4c so less testing would be required.

Regards
 	Mark Fortescue.

[Update-MMUCache-2.patch  TEXT/PLAIN (10.7KB)]
diff -ruNpd linux-2.6.20.9/include/asm-generic/pgtable.h linux-test/include/asm-generic/pgtable.h
--- linux-2.6.20.9/include/asm-generic/pgtable.h	2007-05-01 12:57:56.000000000 +0100
+++ linux-test/include/asm-generic/pgtable.h	2007-05-01 23:13:23.000000000 +0100
@@ -30,10 +30,17 @@ do {				  					\
  * to optimize this.
  */
 #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
-do {				  					  \
-	set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry);	  \
-	flush_tlb_page(__vma, __address);				  \
-} while (0)
+({									  \
+	int __update = !pte_same(*(__ptep), __entry);			  \
+									  \
+	if (__update) {				  			  \
+		set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \
+		flush_tlb_page(__vma, __address);			  \
+	} else if (__dirty) {						  \
+		flush_tlb_page(__vma, __address);			  \
+	}								  \
+	__update;							  \
+})
We never seemed to reach completion here?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help