linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: Arjan van de Ven <arjan@intel.linux.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@suse.de>, Andrew Morton <akpm@osdl.org>
Subject: Re: [Patch 3/3] prepopulate/cache cleared pages
Date: Thu, 23 Feb 2006 16:10:01 -0500	[thread overview]
Message-ID: <200602231611_MC3-1-B91D-9C03@compuserve.com> (raw)

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


             reply	other threads:[~2006-02-23 21:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-23 21:10 Chuck Ebbert [this message]
2006-02-23 21:18 ` [Patch 3/3] prepopulate/cache cleared pages Arjan van de Ven
  -- strict thread matches above, loose matches on Subject: below --
2006-02-23 20:02 Chuck Ebbert
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

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=200602231611_MC3-1-B91D-9C03@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=arjan@intel.linux.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 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).