linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-mm@kvack.org
Subject: Re: drain_node_pages: interrupt latency reduction / optimization
Date: Fri, 10 Mar 2006 16:28:26 -0800	[thread overview]
Message-ID: <20060310162826.5f7a50e4.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0603101605410.31461@schroedinger.engr.sgi.com>

Christoph Lameter <clameter@sgi.com> wrote:
>
> Here is a fixup adding some comments and raw_smp_processor_id()
> 
> Signed-off-by: Christoph Lameter <clameter@sgi.com>
> 
> Index: linux-2.6/mm/page_alloc.c
> ===================================================================
> --- linux-2.6.orig/mm/page_alloc.c	2006-03-10 16:09:10.000000000 -0800
> +++ linux-2.6/mm/page_alloc.c	2006-03-10 16:10:07.000000000 -0800
> @@ -593,6 +593,8 @@ static int rmqueue_bulk(struct zone *zon
>  /*
>   * Called from the slab reaper to drain pagesets on a particular node that
>   * belong to the currently executing processor.
> + * Note that this function must be called with the thread pinned to
> + * a processor.
>   */
>  void drain_node_pages(int nodeid)
>  {
> @@ -603,7 +605,7 @@ void drain_node_pages(int nodeid)
>  		struct zone *zone = NODE_DATA(nodeid)->node_zones + z;
>  		struct per_cpu_pageset *pset;
>  
> -		pset = zone_pcp(zone, smp_processor_id());
> +		pset = zone_pcp(zone, raw_smp_processor_id());
>  		for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) {
>  			struct per_cpu_pages *pcp;

hm.  That replaces a runtime check with a comment.  If someone comes along
and reuses this function wrongly they'll have a nasty subtle bug.

IOW: it might be best to keep the smp_processor_id() check in there.

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-03-11  0:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-10 20:59 Christoph Lameter
2006-03-11  0:05 ` Andrew Morton
2006-03-11  0:15   ` Christoph Lameter
2006-03-11  0:28     ` Andrew Morton [this message]
2006-03-11  0:33       ` Christoph Lameter

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=20060310162826.5f7a50e4.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=linux-mm@kvack.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