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-kernel@vger.kernel.org, linux-mm@kvack.org,
	npiggin@suse.de, ak@suse.de, hugh@veritas.com
Subject: Re: Light weight counter 1/1 Framework
Date: Fri, 9 Jun 2006 14:33:33 -0700	[thread overview]
Message-ID: <20060609143333.39b29109.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0606091216320.1174@schroedinger.engr.sgi.com>

Christoph Lameter <clameter@sgi.com> wrote:
>
> -/*
> - * Accumulate the page_state information across all CPUs.
> - * The result is unavoidably approximate - it can change
> - * during and after execution of this function.
> - */

sob.  How about updating the nice comment rather than removing it?

>  
> -void get_full_page_state(struct page_state *ret)
> +void all_vm_events(unsigned long *ret)
>  {
> -	cpumask_t mask = CPU_MASK_ALL;
> -
> -	__get_page_state(ret, sizeof(*ret) / sizeof(unsigned long), &mask);
> +	sum_vm_events(ret, &cpu_online_map);
>  }
> +EXPORT_SYMBOL(all_vm_events);
>  
> -unsigned long read_page_state_offset(unsigned long offset)
> +unsigned long get_global_vm_events(enum vm_event_item e)
>  {
>  	unsigned long ret = 0;
>  	int cpu;
>  
> -	for_each_online_cpu(cpu) {
> -		unsigned long in;
> +	for_each_possible_cpu(cpu)
> +		ret += per_cpu(vm_event_states, cpu).event[e];
>  
> -		in = (unsigned long)&per_cpu(page_states, cpu) + offset;
> -		ret += *((unsigned long *)in);
> -	}
>  	return ret;
>  }

Here.   Some description of the difference between these two, and why one
would call one and not the other.

I'd be rather interested in reading that comment because afaict,
get_global_vm_events() has no callers.

And nor should it, please.  It has potential to be seriously inefficient. 
Much, much better to kill this function and to implement a CPU hotplug
notifier to spill the going-away CPU's stats into another CPU's
accumulators.

--
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>

  parent reply	other threads:[~2006-06-09 21:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-09 19:18 Christoph Lameter
2006-06-09 19:19 ` Light weight counter 2/2 counter conversion Christoph Lameter
2006-06-09 21:33 ` Andrew Morton [this message]
2006-06-09 22:38   ` Light weight counter 1/1 Framework Christoph Lameter
2006-06-09 23:07     ` Andrew Morton
2006-06-09 23:15     ` Andrew Morton

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=20060609143333.39b29109.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ak@suse.de \
    --cc=clameter@sgi.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    /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