[lkml]   [2012]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[ 35/94] um: Implement a custom pte_same() function
3.3-stable review patch.  If anyone has any objections, please let me know.


From: Richard Weinberger <>

commit f15b9000eb1d09bbaa4b0a6b2089d7e1f64e84b3 upstream.

UML uses the _PAGE_NEWPAGE flag to mark pages which are not jet
installed on the host side using mmap().
pte_same() has to ignore this flag, otherwise unuse_pte_range()
is unable to unuse the page because two identical
page tables entries with different _PAGE_NEWPAGE flags would not
match and swapoff() would never return.

Analyzed-by: Hugh Dickins <>
Signed-off-by: Richard Weinberger <>
Signed-off-by: Greg Kroah-Hartman <>

arch/um/include/asm/pgtable.h | 6 ++++++
1 file changed, 6 insertions(+)

--- a/arch/um/include/asm/pgtable.h
+++ b/arch/um/include/asm/pgtable.h
@@ -271,6 +271,12 @@ static inline void set_pte(pte_t *pteptr
#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)

+static inline int pte_same(pte_t pte_a, pte_t pte_b)
+ return !((pte_val(pte_a) ^ pte_val(pte_b)) & ~_PAGE_NEWPAGE);
* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.

 \ /
  Last update: 2012-05-27 04:42    [W:0.581 / U:3.996 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site