From: Dimitri Sivanich <sivanich@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] ia64: smp_flush_tlb_mm() should only send IPI's to cpus in
Date: Wed, 15 Apr 2009 15:56:25 +0000 [thread overview]
Message-ID: <20090415155625.GA26750@sgi.com> (raw)
Having flush_tlb_mm->smp_flush_tlb_mm() send an IPI to every cpu on the
system is occasionally triggering spin_lock contention in
generic_smp_call_function_interrupt().
The x86 arch only sends IPIs to the cpus in mm->cpu_vm_mask. Does anybody
see any reason why ia64 shouldn't do this as well?
I have noticed significant improvement in this contention issue with the
following patch.
Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
---
arch/ia64/kernel/smp.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index 2ea4199..5c1787b 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -300,15 +300,12 @@ smp_flush_tlb_mm (struct mm_struct *mm)
return;
}
+ smp_call_function_mask(mm->cpu_vm_mask,
+ (void (*)(void *))local_finish_flush_tlb_mm, mm, 1);
+ local_irq_disable();
+ local_finish_flush_tlb_mm(mm);
+ local_irq_enable();
preempt_enable();
- /*
- * We could optimize this further by using mm->cpu_vm_mask to track which CPUs
- * have been running in the address space. It's not clear that this is worth the
- * trouble though: to avoid races, we have to raise the IPI on the target CPU
- * anyhow, and once a CPU is interrupted, the cost of local_flush_tlb_all() is
- * rather trivial.
- */
- on_each_cpu((void (*)(void *))local_finish_flush_tlb_mm, mm, 1);
}
void arch_send_call_function_single_ipi(int cpu)
--
1.5.4.rc3
reply other threads:[~2009-04-15 15:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090415155625.GA26750@sgi.com \
--to=sivanich@sgi.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.