All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zou Nan hai <nanhai.zou@intel.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] - Optional method to purge the TLB on SN systems
Date: Wed, 28 Mar 2007 00:46:44 +0000	[thread overview]
Message-ID: <1175042804.15565.9.camel@linux-znh> (raw)
In-Reply-To: <20070327193925.GA8615@sgi.com>

On Wed, 2007-03-28 at 03:39, Jack Steiner wrote:

> This patch adds an optional method for purging the TLB on SN IA64 systems.
> The change should not affect any non-SN system.
> 
> 	Signed-off-by: Jack Steiner <steiner@sgi.com>
> 
> ---
> 
> +void
> +smp_flush_tlb_cpumask (cpumask_t xcpumask)
> +{
> +	unsigned short counts[NR_CPUS];
> +	cpumask_t cpumask = xcpumask;
> +	int count, mycpu, cpu, flush_mycpu = 0;
> +
> +	preempt_disable();
> +	mycpu = smp_processor_id();
> +
> +	for_each_cpu_mask(cpu, cpumask) {
> +		counts[cpu] = per_cpu(local_flush_count, cpu);
> +		mb();
> +		if (cpu = mycpu)
> +			flush_mycpu = 1;
> +		else
> +			smp_send_local_flush_tlb(cpu);
> +	}
> +
> +	if (flush_mycpu)
> +		smp_local_flush_tlb();
> +
> +	for_each_cpu_mask(cpu, cpumask) {
> +		count = 0;
> +		while(counts[cpu] = per_cpu(local_flush_count, cpu)) {

Due to 64k offset of percpu data, the same percpu variable on different
CPUs are very likely to be on the same cacheline of some levels of
cache.

So I think the operation on local_flush_count may be very cache
unfriendly...


Zou Nan hai





  parent reply	other threads:[~2007-03-28  0:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-27 19:39 [PATCH] - Optional method to purge the TLB on SN systems Jack Steiner
2007-03-27 20:24 ` Luck, Tony
2007-03-27 20:33 ` Jack Steiner
2007-03-27 22:32 ` Luck, Tony
2007-03-27 22:46 ` Jack Steiner
2007-03-28  0:46 ` Zou Nan hai [this message]
2007-03-28  1:53 ` Jack Steiner
2007-03-28  3:03 ` Zou, Nanhai
2007-03-28  3:26 ` Jack Steiner
2007-04-05 21:39 ` Jack Steiner

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=1175042804.15565.9.camel@linux-znh \
    --to=nanhai.zou@intel.com \
    --cc=linux-ia64@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 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.