Re: [PATCH V2 0/2] Enable clients to schedule in mmu_notifier methods

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu,  6 Sep 2012 17:34:53 +0300
Haggai Eran <haggaie@xxxxxxxxxxxx> wrote:

>  include/linux/mmu_notifier.h | 47 --------------------------------------------
>  kernel/events/uprobes.c      |  5 +++++
>  mm/filemap_xip.c             |  4 +++-
>  mm/huge_memory.c             | 42 +++++++++++++++++++++++++++++++++------
>  mm/hugetlb.c                 | 21 ++++++++++++--------
>  mm/ksm.c                     | 21 ++++++++++++++++++--
>  mm/memory.c                  | 25 ++++++++++++++++++-----
>  mm/mmu_notifier.c            |  6 ------
>  mm/mremap.c                  |  8 ++++++--
>  mm/rmap.c                    | 18 ++++++++++++++---
>  10 files changed, 117 insertions(+), 80 deletions(-)

ho hum, spose so - the maintenance overhead does look to be a bit less now.

I use an ancient gcc. Do you see these with newer gcc?

mm/memory.c: In function 'do_wp_page':
mm/memory.c:2529: warning: 'mmun_start' may be used uninitialized in this function
mm/memory.c:2530: warning: 'mmun_end' may be used uninitialized in this function
mm/memory.c: In function 'copy_page_range':
mm/memory.c:1042: warning: 'mmun_start' may be used uninitialized in this function
mm/memory.c:1043: warning: 'mmun_end' may be used uninitialized in this function

The copy_page_range() one is a bit of a worry.  We're assuming that the
return value of is_cow_mapping(vma->vm_flags) will not change.  It
would be pretty alarming if it *were* to change, but exactly what
guarantees this?


I fiddled a couple of minor things:

From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Subject: mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix

possible speed tweak in hugetlb_cow(), cleanups

Cc: Andrea Arcangeli <andrea@xxxxxxxxxxxx>
Cc: Avi Kivity <avi@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxxxxxxxxxxxxx>
Cc: Haggai Eran <haggaie@xxxxxxxxxxxx>
Cc: Liran Liss <liranl@xxxxxxxxxxxx>
Cc: Or Gerlitz <ogerlitz@xxxxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Sagi Grimberg <sagig@xxxxxxxxxxxx>
Cc: Shachar Raindel <raindel@xxxxxxxxxxxx>
Cc: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/hugetlb.c |    2 +-
 mm/memory.c  |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

--- a/mm/hugetlb.c~mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix
+++ a/mm/hugetlb.c
@@ -2616,7 +2616,7 @@ retry_avoidcopy:
 	__SetPageUptodate(new_page);
 
 	mmun_start = address & huge_page_mask(h);
-	mmun_end   = (address & huge_page_mask(h)) + huge_page_size(h);
+	mmun_end = mmun_start + huge_page_size(h);
 	mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
 	/*
 	 * Retake the page_table_lock to check for racing updates
--- a/mm/memory.c~mm-move-all-mmu-notifier-invocations-to-be-done-outside-the-pt-lock-fix
+++ a/mm/memory.c
@@ -1096,8 +1096,7 @@ int copy_page_range(struct mm_struct *ds
 	} while (dst_pgd++, src_pgd++, addr = next, addr != end);
 
 	if (is_cow_mapping(vma->vm_flags))
-		mmu_notifier_invalidate_range_end(src_mm, mmun_start,
-						  mmun_end);
+		mmu_notifier_invalidate_range_end(src_mm, mmun_start, mmun_end);
 	return ret;
 }
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]