[lkml]   [2019]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[RFC PATCH 1/4] uprobes: use set_pte_at() not set_pte_at_notify()
From: Jérôme Glisse <>

Using set_pte_at_notify() trigger useless calls to change_pte() so just
use set_pte_at() instead. The reason is that set_pte_at_notify() should
only be use when going from either a read and write pte to read only pte
with same pfn, or from read only to read and write with a different pfn.

The set_pte_at_notify() was use because __replace_page() code came from
the mm/ksm.c code in which the above rules are valid.

Signed-off-by: Jérôme Glisse <>
Cc: Andrea Arcangeli <>
Cc: Peter Xu <>
Cc: Peter Zijlstra <>
Cc: Ingo Molnar <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Alexander Shishkin <>
Cc: Jiri Olsa <>
Cc: Namhyung Kim <>
Cc: Andrew Morton <>
Cc: Matthew Wilcox <>
Cc: Paolo Bonzini <>
Cc: Radim Krčmář <>
Cc: Michal Hocko <>
kernel/events/uprobes.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 87e76a1dc758..a4807b1edd7f 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -207,8 +207,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,

flush_cache_page(vma, addr, pte_pfn(*pvmw.pte));
ptep_clear_flush_notify(vma, addr, pvmw.pte);
- set_pte_at_notify(mm, addr, pvmw.pte,
- mk_pte(new_page, vma->vm_page_prot));
+ set_pte_at(mm, addr, pvmw.pte, mk_pte(new_page, vma->vm_page_prot));

page_remove_rmap(old_page, false);
if (!page_mapped(old_page))
 \ /
  Last update: 2019-01-31 19:38    [W:0.084 / U:2.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site