linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch 0/3] threaded mmap tweaks
@ 2006-02-23  9:17 Arjan van de Ven
  2006-02-23  9:29 ` [Patch 3/3] prepopulate/cache cleared pages Arjan van de Ven
  2006-02-23  9:30 ` [Patch 2/3] fast VMA recycling Arjan van de Ven
  0 siblings, 2 replies; 35+ messages in thread
From: Arjan van de Ven @ 2006-02-23  9:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

Hi,

I've been looking at a micro-benchmark that basically starts a few
threads which then each allocate some memory (via mmap), use it briefly
and then free it again (munmap). During this benchmark the mmap_sem gets
contended and as a result things go less well than expected. The patches
in this series improved the benchmark by 3% on a wallclock time basis.

Greetings,
   Arjan van de Ven

^ permalink raw reply	[flat|nested] 35+ messages in thread
* Re: [Patch 3/3] prepopulate/cache cleared pages
@ 2006-02-23 20:02 Chuck Ebbert
  0 siblings, 0 replies; 35+ messages in thread
From: Chuck Ebbert @ 2006-02-23 20:02 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andrew Morton, Arjan van de Ven, Ingo Molnar, linux-kernel

In-Reply-To: <200602231406.43899.ak@suse.de>

On Thu, 23 Feb 2006 at 14:06:43 +0100, Andi Kleen wrote:
> e.g. you might notice that a lot of patches from new contributors
> go smoother into x86-64 than into i386.

 That's because, strangely enough, i386 doesn't have an official maintainer.

-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert


^ permalink raw reply	[flat|nested] 35+ messages in thread
* Re: [Patch 3/3] prepopulate/cache cleared pages
@ 2006-02-23 21:10 Chuck Ebbert
  2006-02-23 21:18 ` Arjan van de Ven
  0 siblings, 1 reply; 35+ messages in thread
From: Chuck Ebbert @ 2006-02-23 21:10 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: linux-kernel, Andi Kleen, Andrew Morton

In-Reply-To: <1140686994.4672.4.camel@laptopd505.fenrus.org>

On Thu, 23 Feb 2006 at 10:29:54 +0100, Arjan van de Ven wrote:

> Index: linux-work/mm/mempolicy.c
> ===================================================================
> --- linux-work.orig/mm/mempolicy.c
> +++ linux-work/mm/mempolicy.c
> @@ -1231,6 +1231,13 @@ alloc_page_vma(gfp_t gfp, struct vm_area
>  {
>       struct mempolicy *pol = get_vma_policy(current, vma, addr);
>  
> +     if ( (gfp & __GFP_ZERO) && current->cleared_page) {
> +             struct page *addr;
> +             addr = current->cleared_page;
> +             current->cleared_page = NULL;
> +             return addr;
> +     }
> +
>       cpuset_update_task_memory_state();
>  
>       if (unlikely(pol->policy == MPOL_INTERLEAVE)) {
> @@ -1242,6 +1249,36 @@ alloc_page_vma(gfp_t gfp, struct vm_area
>       return __alloc_pages(gfp, 0, zonelist_policy(gfp, pol));
>  }
>  
> +
> +/**
> + *   prepare_cleared_page - populate the per-task zeroed-page cache
> + *
> + *   This function populates the per-task cache with one zeroed page
> + *   (if there wasn't one already)
> + *   The idea is that this (expensive) clearing is done before any
> + *   locks are taken, speculatively, and that when the page is actually
> + *   needed under a lock, it is ready for immediate use
> + */
> +
> +void prepare_cleared_page(void)
> +{
> +     struct mempolicy *pol = current->mempolicy;
> +
> +     if (current->cleared_page)
> +             return;
> +
> +     cpuset_update_task_memory_state();
> +
> +     if (!pol)
> +             pol = &default_policy;
> +     if (pol->policy == MPOL_INTERLEAVE)
> +             current->cleared_page = alloc_page_interleave(
> +                     GFP_HIGHUSER | __GFP_ZERO, 0, interleave_nodes(pol));

======> else ???

> +     current->cleared_page = __alloc_pages(GFP_USER | __GFP_ZERO,
> +                     0, zonelist_policy(GFP_USER, pol));
> +}
> +
> +
>  /**
>   *   alloc_pages_current - Allocate pages.
>   *

-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2006-02-28 22:32 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-23  9:17 [Patch 0/3] threaded mmap tweaks Arjan van de Ven
2006-02-23  9:29 ` [Patch 3/3] prepopulate/cache cleared pages Arjan van de Ven
2006-02-23  9:41   ` Andi Kleen
2006-02-23 12:41     ` Ingo Molnar
2006-02-23 13:06       ` Andi Kleen
2006-02-23 13:15         ` Nick Piggin
2006-02-23 13:29           ` Ingo Molnar
2006-02-24  6:36             ` Nick Piggin
2006-02-24  6:49               ` Ingo Molnar
2006-02-24  7:01                 ` Nick Piggin
2006-02-24 12:33                   ` Andi Kleen
2006-02-24 12:55                     ` Hugh Dickins
2006-02-24  9:15               ` Arjan van de Ven
2006-02-24  9:26                 ` Nick Piggin
2006-02-24 12:27                   ` Andi Kleen
2006-02-24 15:31                     ` Andrea Arcangeli
2006-02-25 16:48                     ` Nick Piggin
2006-02-25 17:22                       ` Nick Piggin
2006-02-28 22:30       ` Pavel Machek
2006-02-23 18:25   ` Paul Jackson
2006-02-23  9:30 ` [Patch 2/3] fast VMA recycling Arjan van de Ven
2006-02-23  9:42   ` Andi Kleen
2006-02-23  9:48     ` Arjan van de Ven
2006-02-23 10:05       ` Andi Kleen
2006-02-23 10:15         ` Arjan van de Ven
2006-02-23 11:00           ` Andi Kleen
2006-02-23 11:22             ` Arjan van de Ven
2006-02-23 11:57               ` Andi Kleen
2006-02-24 18:52       ` Christoph Hellwig
2006-02-24 19:05         ` Andi Kleen
2006-02-24 19:09           ` Christoph Hellwig
2006-02-23 16:37   ` Benjamin LaHaise
2006-02-23 20:02 [Patch 3/3] prepopulate/cache cleared pages Chuck Ebbert
2006-02-23 21:10 Chuck Ebbert
2006-02-23 21:18 ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).