From: Andrew Morton <akpm@linux-foundation.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>,
Linux-MM <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Nick Piggin <npiggin@kernel.dk>,
Xen-devel <xen-devel@lists.xensource.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Subject: Re: [PATCH 0/9] Add apply_to_page_range_batch() and use it
Date: Thu, 27 Jan 2011 16:18:17 -0800 [thread overview]
Message-ID: <20110127161817.9cbcae91.akpm@linux-foundation.org> (raw)
In-Reply-To: <cover.1295653400.git.jeremy.fitzhardinge@citrix.com>
On Mon, 24 Jan 2011 14:55:58 -0800
Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>
> I'm proposing this series for 2.6.39.
>
> We've had apply_to_page_range() for a while, which is a general way to
> apply a function to ptes across a range of addresses - including
> allocating any missing parts of the pagetable as needed. This logic
> is replicated in a number of places throughout the kernel, but it
> hasn't been widely replaced by this function, partly because of
> concerns about the overhead of calling the function once per pte.
>
> This series adds apply_to_page_range_batch() (and reimplements
> apply_to_page_range() in terms of it), which calls the pte operation
> function once per pte page, moving the inner loop into the callback
> function.
>
> apply_to_page_range(_batch) also calls its callback with lazy mmu
> updates enabled, which allows batching of the operations in
> environments where this is beneficial (ie, virtualization). The only
> caveat this introduces is callbacks can't expect to immediately see
> the effects of the pte updates in memory.
>
> Since this is effectively identical to the code in lib/ioremap.c and
> mm/vmalloc.c (twice!), I replace their open-coded variants. I'm sure
> there are others places in the kernel which could do with this (I only
> stumbled over ioremap by accident).
>
> I also add a minor optimisation to vunmap_page_range() to use a
> plain pte_clear() rather than the more expensive and unnecessary
> ptep_get_and_clear().
>
> Jeremy Fitzhardinge (9):
> mm: remove unused "token" argument from apply_to_page_range callback.
> mm: add apply_to_page_range_batch()
> ioremap: use apply_to_page_range_batch() for ioremap_page_range()
> vmalloc: use plain pte_clear() for unmaps
> vmalloc: use apply_to_page_range_batch() for vunmap_page_range()
> vmalloc: use apply_to_page_range_batch() for
> vmap_page_range_noflush()
> vmalloc: use apply_to_page_range_batch() in alloc_vm_area()
> xen/mmu: use apply_to_page_range_batch() in
> xen_remap_domain_mfn_range()
> xen/grant-table: use apply_to_page_range_batch()
>
> arch/x86/xen/grant-table.c | 30 +++++----
> arch/x86/xen/mmu.c | 18 +++--
> include/linux/mm.h | 9 ++-
> lib/ioremap.c | 85 +++++++------------------
> mm/memory.c | 57 ++++++++++++-----
> mm/vmalloc.c | 150 ++++++++++++--------------------------------
> 6 files changed, 140 insertions(+), 209 deletions(-)
That all looks good to me.
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>,
Linux-MM <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Nick Piggin <npiggin@kernel.dk>,
Xen-devel <xen-devel@lists.xensource.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Subject: Re: [PATCH 0/9] Add apply_to_page_range_batch() and use it
Date: Thu, 27 Jan 2011 16:18:17 -0800 [thread overview]
Message-ID: <20110127161817.9cbcae91.akpm@linux-foundation.org> (raw)
In-Reply-To: <cover.1295653400.git.jeremy.fitzhardinge@citrix.com>
On Mon, 24 Jan 2011 14:55:58 -0800
Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>
> I'm proposing this series for 2.6.39.
>
> We've had apply_to_page_range() for a while, which is a general way to
> apply a function to ptes across a range of addresses - including
> allocating any missing parts of the pagetable as needed. This logic
> is replicated in a number of places throughout the kernel, but it
> hasn't been widely replaced by this function, partly because of
> concerns about the overhead of calling the function once per pte.
>
> This series adds apply_to_page_range_batch() (and reimplements
> apply_to_page_range() in terms of it), which calls the pte operation
> function once per pte page, moving the inner loop into the callback
> function.
>
> apply_to_page_range(_batch) also calls its callback with lazy mmu
> updates enabled, which allows batching of the operations in
> environments where this is beneficial (ie, virtualization). The only
> caveat this introduces is callbacks can't expect to immediately see
> the effects of the pte updates in memory.
>
> Since this is effectively identical to the code in lib/ioremap.c and
> mm/vmalloc.c (twice!), I replace their open-coded variants. I'm sure
> there are others places in the kernel which could do with this (I only
> stumbled over ioremap by accident).
>
> I also add a minor optimisation to vunmap_page_range() to use a
> plain pte_clear() rather than the more expensive and unnecessary
> ptep_get_and_clear().
>
> Jeremy Fitzhardinge (9):
> mm: remove unused "token" argument from apply_to_page_range callback.
> mm: add apply_to_page_range_batch()
> ioremap: use apply_to_page_range_batch() for ioremap_page_range()
> vmalloc: use plain pte_clear() for unmaps
> vmalloc: use apply_to_page_range_batch() for vunmap_page_range()
> vmalloc: use apply_to_page_range_batch() for
> vmap_page_range_noflush()
> vmalloc: use apply_to_page_range_batch() in alloc_vm_area()
> xen/mmu: use apply_to_page_range_batch() in
> xen_remap_domain_mfn_range()
> xen/grant-table: use apply_to_page_range_batch()
>
> arch/x86/xen/grant-table.c | 30 +++++----
> arch/x86/xen/mmu.c | 18 +++--
> include/linux/mm.h | 9 ++-
> lib/ioremap.c | 85 +++++++------------------
> mm/memory.c | 57 ++++++++++++-----
> mm/vmalloc.c | 150 ++++++++++++--------------------------------
> 6 files changed, 140 insertions(+), 209 deletions(-)
That all looks good to me.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-01-28 0:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 22:55 [PATCH 0/9] Add apply_to_page_range_batch() and use it Jeremy Fitzhardinge
2011-01-24 22:55 ` Jeremy Fitzhardinge
2011-01-24 22:55 ` [PATCH 1/9] mm: remove unused "token" argument from apply_to_page_range callback Jeremy Fitzhardinge
2011-01-24 22:55 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 2/9] mm: add apply_to_page_range_batch() Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 3/9] ioremap: use apply_to_page_range_batch() for ioremap_page_range() Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 4/9] vmalloc: use plain pte_clear() for unmaps Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 5/9] vmalloc: use apply_to_page_range_batch() for vunmap_page_range() Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 6/9] vmalloc: use apply_to_page_range_batch() for vmap_page_range_noflush() Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 7/9] vmalloc: use apply_to_page_range_batch() in alloc_vm_area() Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 8/9] xen/mmu: use apply_to_page_range_batch() in xen_remap_domain_mfn_range() Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 9/9] xen/grant-table: use apply_to_page_range_batch() Jeremy Fitzhardinge
2011-01-24 22:56 ` Jeremy Fitzhardinge
2011-01-28 0:18 ` Andrew Morton [this message]
2011-01-28 0:18 ` [PATCH 0/9] Add apply_to_page_range_batch() and use it Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2010-12-15 22:19 Jeremy Fitzhardinge
2010-12-15 22:19 ` Jeremy Fitzhardinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110127161817.9cbcae91.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=hskinnemoen@atmel.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@kernel.dk \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.