* [PATCH] remove mmu notifier calls in apply_to_page_range
@ 2010-07-09 17:44 Jeremy Fitzhardinge
2010-07-12 12:50 ` Stefano Stabellini
0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2010-07-09 17:44 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: Andrea Arcangeli, Stefano Stabellini, Andrew Morton
It is not appropriate for apply_to_page_range() to directly call any
mmu notifiers, because it is a general purpose function whose effect
depends on what context it is called in and what the callback function
does.
In particular, if it is being used as part of an mmu notifier
implementation, the recursive calls can be particularly problematic.
It is up to apply_to_page_range's caller to do any notifier calls
if necessary. It does not affect any in-tree users because they
all operate on init_mm, and mmu notifiers only pertain to usermode
mappings.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
diff --git a/mm/memory.c b/mm/memory.c
index 6ab19dd..d6b89eb 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1890,7 +1890,6 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
int err;
BUG_ON(addr >= end);
- mmu_notifier_invalidate_range_start(mm, start, end);
pgd = pgd_offset(mm, addr);
do {
next = pgd_addr_end(addr, end);
@@ -1898,7 +1897,7 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
if (err)
break;
} while (pgd++, addr = next, addr != end);
- mmu_notifier_invalidate_range_end(mm, start, end);
+
return err;
}
EXPORT_SYMBOL_GPL(apply_to_page_range);
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] remove mmu notifier calls in apply_to_page_range
2010-07-09 17:44 [PATCH] remove mmu notifier calls in apply_to_page_range Jeremy Fitzhardinge
@ 2010-07-12 12:50 ` Stefano Stabellini
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Stabellini @ 2010-07-12 12:50 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Linux Kernel Mailing List, Andrea Arcangeli, Stefano Stabellini,
Andrew Morton
On Fri, 9 Jul 2010, Jeremy Fitzhardinge wrote:
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 6ab19dd..d6b89eb 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1890,7 +1890,6 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
> int err;
>
> BUG_ON(addr >= end);
> - mmu_notifier_invalidate_range_start(mm, start, end);
> pgd = pgd_offset(mm, addr);
> do {
> next = pgd_addr_end(addr, end);
> @@ -1898,7 +1897,7 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
> if (err)
> break;
> } while (pgd++, addr = next, addr != end);
> - mmu_notifier_invalidate_range_end(mm, start, end);
> +
> return err;
> }
> EXPORT_SYMBOL_GPL(apply_to_page_range);
>
>
>
The local variable start in apply_to_page_range is not used anymore:
remove it.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
diff --git a/mm/memory.c b/mm/memory.c
index 9d33bfe..0a47927 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1989,7 +1989,7 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
{
pgd_t *pgd;
unsigned long next;
- unsigned long start = addr, end = addr + size;
+ unsigned long end = addr + size;
int err;
BUG_ON(addr >= end);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-12 12:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-09 17:44 [PATCH] remove mmu notifier calls in apply_to_page_range Jeremy Fitzhardinge
2010-07-12 12:50 ` Stefano Stabellini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox