mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: Ingo Molnar <mingo@elte.hu>, Rusty Russell <rusty@rustcorp.com.au>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	Yinghai Lu <yhlu.kernel@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jack Steiner <steiner@sgi.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 26/31] cpumask: clean tlb files
Date: Mon, 29 Sep 2008 11:03:16 -0700	[thread overview]
Message-ID: <20080929180253.667326000@polaris-admin.engr.sgi.com> (raw)
In-Reply-To: <20080929180250.111209000@polaris-admin.engr.sgi.com>

[-- Attachment #1: clean-tlb --]
[-- Type: text/plain, Size: 7417 bytes --]

Signed-of-by: Mike Travis <travis@sgi.com>
---
 arch/x86/kernel/tlb_32.c   |   24 ++++++++++++------------
 arch/x86/kernel/tlb_64.c   |   23 ++++++++++++-----------
 arch/x86/kernel/tlb_uv.c   |   12 ++++++------
 include/asm-x86/tlbflush.h |    6 +++---
 4 files changed, 33 insertions(+), 32 deletions(-)

--- struct-cpumasks.orig/arch/x86/kernel/tlb_32.c
+++ struct-cpumasks/arch/x86/kernel/tlb_32.c
@@ -20,7 +20,7 @@ DEFINE_PER_CPU(struct tlb_state, cpu_tlb
  *	Optimizations Manfred Spraul <manfred@colorfullife.com>
  */
 
-static cpumask_t flush_cpumask;
+static cpumask_map_t flush_cpumask;
 static struct mm_struct *flush_mm;
 static unsigned long flush_va;
 static DEFINE_SPINLOCK(tlbstate_lock);
@@ -122,10 +122,10 @@ out:
 	__get_cpu_var(irq_stat).irq_tlb_count++;
 }
 
-void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
+void native_flush_tlb_others(const_cpumask_t cpumaskp, struct mm_struct *mm,
 			     unsigned long va)
 {
-	cpumask_t cpumask = *cpumaskp;
+	cpumask_var_t cpumask;
 
 	/*
 	 * A couple of (to be removed) sanity checks:
@@ -133,13 +133,13 @@ void native_flush_tlb_others(const cpuma
 	 * - current CPU must not be in mask
 	 * - mask must exist :)
 	 */
-	BUG_ON(cpus_empty(cpumask));
-	BUG_ON(cpu_isset(smp_processor_id(), cpumask));
+	BUG_ON(cpus_empty(cpumaskp));
+	BUG_ON(cpu_isset(smp_processor_id(), cpumaskp));
 	BUG_ON(!mm);
 
 #ifdef CONFIG_HOTPLUG_CPU
 	/* If a CPU which we ran on has gone down, OK. */
-	cpus_and(cpumask, cpumask, cpu_online_map);
+	cpus_and(cpumask, cpumaskp, cpu_online_map);
 	if (unlikely(cpus_empty(cpumask)))
 		return;
 #endif
@@ -172,10 +172,10 @@ void native_flush_tlb_others(const cpuma
 void flush_tlb_current_task(void)
 {
 	struct mm_struct *mm = current->mm;
-	cpumask_t cpu_mask;
+	cpumask_var_t cpu_mask;
 
 	preempt_disable();
-	cpu_mask = mm->cpu_vm_mask;
+	cpus_copy(cpu_mask, mm->cpu_vm_mask);
 	cpu_clear(smp_processor_id(), cpu_mask);
 
 	local_flush_tlb();
@@ -186,10 +186,10 @@ void flush_tlb_current_task(void)
 
 void flush_tlb_mm(struct mm_struct *mm)
 {
-	cpumask_t cpu_mask;
+	cpumask_var_t cpu_mask;
 
 	preempt_disable();
-	cpu_mask = mm->cpu_vm_mask;
+	cpus_copy(cpu_mask, mm->cpu_vm_mask);
 	cpu_clear(smp_processor_id(), cpu_mask);
 
 	if (current->active_mm == mm) {
@@ -207,10 +207,10 @@ void flush_tlb_mm(struct mm_struct *mm)
 void flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	cpumask_t cpu_mask;
+	cpumask_var_t cpu_mask;
 
 	preempt_disable();
-	cpu_mask = mm->cpu_vm_mask;
+	cpus_copy(cpu_mask, mm->cpu_vm_mask);
 	cpu_clear(smp_processor_id(), cpu_mask);
 
 	if (current->active_mm == mm) {
--- struct-cpumasks.orig/arch/x86/kernel/tlb_64.c
+++ struct-cpumasks/arch/x86/kernel/tlb_64.c
@@ -43,7 +43,7 @@
 
 union smp_flush_state {
 	struct {
-		cpumask_t flush_cpumask;
+		cpumask_map_t flush_cpumask;
 		struct mm_struct *flush_mm;
 		unsigned long flush_va;
 		spinlock_t tlbstate_lock;
@@ -157,14 +157,15 @@ out:
 	add_pda(irq_tlb_count, 1);
 }
 
-void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
+void native_flush_tlb_others(const_cpumask_t cpumaskp, struct mm_struct *mm,
 			     unsigned long va)
 {
 	int sender;
 	union smp_flush_state *f;
-	cpumask_t cpumask = *cpumaskp;
+	cpumask_var_t cpumask;
 
-	if (is_uv_system() && uv_flush_tlb_others(&cpumask, mm, va))
+	cpus_copy(cpumask, cpumaskp);
+	if (is_uv_system() && uv_flush_tlb_others(cpumask, mm, va))
 		return;
 
 	/* Caller has disabled preemption */
@@ -186,7 +187,7 @@ void native_flush_tlb_others(const cpuma
 	 * We have to send the IPI only to
 	 * CPUs affected.
 	 */
-	send_IPI_mask(&cpumask, INVALIDATE_TLB_VECTOR_START + sender);
+	send_IPI_mask(cpumask, INVALIDATE_TLB_VECTOR_START + sender);
 
 	while (!cpus_empty(f->flush_cpumask))
 		cpu_relax();
@@ -210,10 +211,10 @@ core_initcall(init_smp_flush);
 void flush_tlb_current_task(void)
 {
 	struct mm_struct *mm = current->mm;
-	cpumask_t cpu_mask;
+	cpumask_var_t cpu_mask;
 
 	preempt_disable();
-	cpu_mask = mm->cpu_vm_mask;
+	cpus_copy(cpu_mask, mm->cpu_vm_mask);
 	cpu_clear(smp_processor_id(), cpu_mask);
 
 	local_flush_tlb();
@@ -224,10 +225,10 @@ void flush_tlb_current_task(void)
 
 void flush_tlb_mm(struct mm_struct *mm)
 {
-	cpumask_t cpu_mask;
+	cpumask_var_t cpu_mask;
 
 	preempt_disable();
-	cpu_mask = mm->cpu_vm_mask;
+	cpus_copy(cpu_mask, mm->cpu_vm_mask);
 	cpu_clear(smp_processor_id(), cpu_mask);
 
 	if (current->active_mm == mm) {
@@ -245,10 +246,10 @@ void flush_tlb_mm(struct mm_struct *mm)
 void flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	cpumask_t cpu_mask;
+	cpumask_var_t cpu_mask;
 
 	preempt_disable();
-	cpu_mask = mm->cpu_vm_mask;
+	cpus_copy(cpu_mask, mm->cpu_vm_mask);
 	cpu_clear(smp_processor_id(), cpu_mask);
 
 	if (current->active_mm == mm) {
--- struct-cpumasks.orig/arch/x86/kernel/tlb_uv.c
+++ struct-cpumasks/arch/x86/kernel/tlb_uv.c
@@ -216,7 +216,7 @@ static int uv_wait_completion(struct bau
  * unchanged.
  */
 int uv_flush_send_and_wait(int cpu, int this_blade, struct bau_desc *bau_desc,
-			   cpumask_t *cpumaskp)
+			   cpumask_t cpumaskp)
 {
 	int completion_status = 0;
 	int right_shift;
@@ -263,13 +263,13 @@ int uv_flush_send_and_wait(int cpu, int 
 	 * Success, so clear the remote cpu's from the mask so we don't
 	 * use the IPI method of shootdown on them.
 	 */
-	for_each_cpu(bit, *cpumaskp) {
+	for_each_cpu(bit, cpumaskp) {
 		blade = uv_cpu_to_blade_id(bit);
 		if (blade == this_blade)
 			continue;
-		cpu_clear(bit, *cpumaskp);
+		cpu_clear(bit, cpumaskp);
 	}
-	if (!cpus_empty(*cpumaskp))
+	if (!cpus_empty(cpumaskp))
 		return 0;
 	return 1;
 }
@@ -296,7 +296,7 @@ int uv_flush_send_and_wait(int cpu, int 
  * Returns 1 if all remote flushing was done.
  * Returns 0 if some remote flushing remains to be done.
  */
-int uv_flush_tlb_others(cpumask_t *cpumaskp, struct mm_struct *mm,
+int uv_flush_tlb_others(cpumask_t cpumaskp, struct mm_struct *mm,
 			unsigned long va)
 {
 	int i;
@@ -315,7 +315,7 @@ int uv_flush_tlb_others(cpumask_t *cpuma
 	bau_nodes_clear(&bau_desc->distribution, UV_DISTRIBUTION_SIZE);
 
 	i = 0;
-	for_each_cpu(bit, *cpumaskp) {
+	for_each_cpu(bit, cpumaskp) {
 		blade = uv_cpu_to_blade_id(bit);
 		BUG_ON(blade > (UV_DISTRIBUTION_SIZE - 1));
 		if (blade == this_blade) {
--- struct-cpumasks.orig/include/asm-x86/tlbflush.h
+++ struct-cpumasks/include/asm-x86/tlbflush.h
@@ -113,7 +113,7 @@ static inline void flush_tlb_range(struc
 		__flush_tlb();
 }
 
-static inline void native_flush_tlb_others(const cpumask_t *cpumask,
+static inline void native_flush_tlb_others(const_cpumask_t cpumask,
 					   struct mm_struct *mm,
 					   unsigned long va)
 {
@@ -142,7 +142,7 @@ static inline void flush_tlb_range(struc
 	flush_tlb_mm(vma->vm_mm);
 }
 
-void native_flush_tlb_others(const cpumask_t *cpumask, struct mm_struct *mm,
+void native_flush_tlb_others(const_cpumask_t cpumask, struct mm_struct *mm,
 			     unsigned long va);
 
 #define TLBSTATE_OK	1
@@ -166,7 +166,7 @@ static inline void reset_lazy_tlbstate(v
 #endif	/* SMP */
 
 #ifndef CONFIG_PARAVIRT
-#define flush_tlb_others(mask, mm, va)	native_flush_tlb_others(&mask, mm, va)
+#define flush_tlb_others(mask, mm, va)	native_flush_tlb_others(mask, mm, va)
 #endif
 
 static inline void flush_tlb_kernel_range(unsigned long start,

-- 

  parent reply	other threads:[~2008-09-29 18:11 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29 18:02 [PATCH 00/31] cpumask: Provide new cpumask API Mike Travis
2008-09-29 18:02 ` [PATCH 01/31] cpumask: Documentation Mike Travis
2008-09-30 22:49   ` Rusty Russell
2008-10-01  9:13     ` Ingo Molnar
2008-10-02  0:36       ` Rusty Russell
2008-10-02  9:32         ` Ingo Molnar
2008-10-02 12:54         ` Mike Travis
2008-10-03  9:04           ` Ingo Molnar
2008-10-06 15:02             ` Pretty blinking lights vs. monitoring system activity from a system controller Mike Travis
2008-09-29 18:02 ` [PATCH 02/31] cpumask: modify send_IPI_mask interface to accept cpumask_t pointers Mike Travis
2008-09-29 18:02 ` [PATCH 03/31] cpumask: remove min from first_cpu/next_cpu Mike Travis
2008-09-29 18:02 ` [PATCH 04/31] cpumask: move cpu_alloc to separate file Mike Travis
2008-09-29 18:02 ` [PATCH 05/31] cpumask: Provide new cpumask API Mike Travis
2008-09-30  9:11   ` Ingo Molnar
2008-09-30 15:42     ` Mike Travis
2008-09-30 16:17       ` Mike Travis
2008-10-01  9:08         ` Ingo Molnar
2008-09-29 18:02 ` [PATCH 06/31] cpumask: new lib/cpumask.c Mike Travis
2008-09-29 18:02 ` [PATCH 07/31] cpumask: changes to compile init/main.c Mike Travis
2008-09-29 18:02 ` [PATCH 08/31] cpumask: Change cpumask maps Mike Travis
2008-09-29 18:02 ` [PATCH 09/31] cpumask: get rid of _nr functions Mike Travis
2008-09-29 18:03 ` [PATCH 10/31] cpumask: clean cpumask_of_cpu refs Mike Travis
2008-09-29 18:03 ` [PATCH 11/31] cpumask: remove set_cpus_allowed_ptr Mike Travis
2008-09-29 18:03 ` [PATCH 12/31] cpumask: remove CPU_MASK_ALL_PTR Mike Travis
2008-09-29 18:03 ` [PATCH 13/31] cpumask: modify for_each_cpu_mask Mike Travis
2008-09-29 18:03 ` [PATCH 14/31] cpumask: change first/next_cpu to cpus_first/next Mike Travis
2008-09-29 18:03 ` [PATCH 15/31] cpumask: remove node_to_cpumask_ptr Mike Travis
2008-09-29 18:03 ` [PATCH 16/31] cpumask: clean apic files Mike Travis
2008-09-29 18:03 ` [PATCH 17/31] cpumask: clean cpufreq files Mike Travis
2008-09-29 18:03 ` [PATCH 18/31] cpumask: clean sched files Mike Travis
2008-09-29 18:03 ` [PATCH 19/31] cpumask: clean xen files Mike Travis
2008-09-29 18:03 ` [PATCH 20/31] cpumask: clean mm files Mike Travis
2008-09-29 18:03 ` [PATCH 21/31] cpumask: clean acpi files Mike Travis
2008-09-29 18:03 ` [PATCH 22/31] cpumask: clean irq files Mike Travis
2008-09-29 18:03 ` [PATCH 23/31] cpumask: clean pci files Mike Travis
2008-09-29 18:03 ` [PATCH 24/31] cpumask: clean cpu files Mike Travis
2008-09-29 18:03 ` [PATCH 25/31] cpumask: clean rcu files Mike Travis
2008-09-29 18:03 ` Mike Travis [this message]
2008-09-29 18:03 ` [PATCH 27/31] cpumask: clean time files Mike Travis
2008-09-29 18:03 ` [PATCH 28/31] cpumask: clean smp files Mike Travis
2008-09-29 18:03 ` [PATCH 29/31] cpumask: clean trace files Mike Travis
2008-09-29 18:03 ` [PATCH 30/31] cpumask: clean kernel files Mike Travis
2008-09-29 18:03 ` [PATCH 31/31] cpumask: clean misc files Mike Travis

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=20080929180253.667326000@polaris-admin.engr.sgi.com \
    --to=travis@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=steiner@sgi.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yhlu.kernel@gmail.com \
    /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

all inboxes | Powered by JetHome®