* [PATCH 8/13] cpumask: use mm_cpumask() wrapper: m32r
@ 2009-06-12 13:03 Rusty Russell
2009-09-23 13:29 ` Hirokazu Takata
0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2009-06-12 13:03 UTC (permalink / raw)
To: Hirokazu Takata; +Cc: linux-kernel
Makes code futureproof against the impending change to mm->cpu_vm_mask.
It's also a chance to use the new cpumask_ ops which take a pointer
(the older ones are deprecated, but there's no hurry for arch code).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
arch/m32r/include/asm/mmu_context.h | 4 ++--
arch/m32r/kernel/smp.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c
--- a/arch/m32r/kernel/smp.c
+++ b/arch/m32r/kernel/smp.c
@@ -264,7 +264,7 @@ void smp_flush_tlb_mm(struct mm_struct *
preempt_disable();
cpu_id = smp_processor_id();
mmc = &mm->context[cpu_id];
- cpu_mask = mm->cpu_vm_mask;
+ cpu_mask = *mm_cpumask(mm);
cpu_clear(cpu_id, cpu_mask);
if (*mmc != NO_CONTEXT) {
@@ -273,7 +273,7 @@ void smp_flush_tlb_mm(struct mm_struct *
if (mm == current->mm)
activate_context(mm);
else
- cpu_clear(cpu_id, mm->cpu_vm_mask);
+ cpumask_clear_cpu(cpu_id, mm_cpumask(mm));
local_irq_restore(flags);
}
if (!cpus_empty(cpu_mask))
@@ -334,7 +334,7 @@ void smp_flush_tlb_page(struct vm_area_s
preempt_disable();
cpu_id = smp_processor_id();
mmc = &mm->context[cpu_id];
- cpu_mask = mm->cpu_vm_mask;
+ cpu_mask = *mm_cpumask(mm);
cpu_clear(cpu_id, cpu_mask);
#ifdef DEBUG_SMP
@@ -469,7 +469,7 @@ void smp_invalidate_interrupt(void)
if (flush_mm == current->active_mm)
activate_context(flush_mm);
else
- cpu_clear(cpu_id, flush_mm->cpu_vm_mask);
+ cpumask_clear(cpu_id, mm_cpumask(flush_mm));
} else {
unsigned long va = flush_va;
diff --git a/arch/m32r/include/asm/mmu_context.h b/arch/m32r/include/asm/mmu_context.h
--- a/arch/m32r/include/asm/mmu_context.h
+++ b/arch/m32r/include/asm/mmu_context.h
@@ -127,7 +127,7 @@ static inline void switch_mm(struct mm_s
if (prev != next) {
#ifdef CONFIG_SMP
- cpu_set(cpu, next->cpu_vm_mask);
+ cpumask_set_cpu(cpu, mm_cpumask(next));
#endif /* CONFIG_SMP */
/* Set MPTB = next->pgd */
*(volatile unsigned long *)MPTB = (unsigned long)next->pgd;
@@ -135,7 +135,7 @@ static inline void switch_mm(struct mm_s
}
#ifdef CONFIG_SMP
else
- if (!cpu_test_and_set(cpu, next->cpu_vm_mask))
+ if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next))
activate_context(next);
#endif /* CONFIG_SMP */
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 8/13] cpumask: use mm_cpumask() wrapper: m32r
2009-06-12 13:03 [PATCH 8/13] cpumask: use mm_cpumask() wrapper: m32r Rusty Russell
@ 2009-09-23 13:29 ` Hirokazu Takata
2009-09-24 0:05 ` Rusty Russell
0 siblings, 1 reply; 3+ messages in thread
From: Hirokazu Takata @ 2009-09-23 13:29 UTC (permalink / raw)
To: Rusty Russell; +Cc: Hirokazu Takata, linux-kernel
Hello,
I apologize for my too late reply.
I've checked the patch and fixed two typos.
Thank you.
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
---
arch/m32r/include/asm/mmu_context.h | 2 +-
arch/m32r/kernel/smp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/m32r/include/asm/mmu_context.h b/arch/m32r/include/asm/mmu_context.h
index a735cc5..a70a3df 100644
--- a/arch/m32r/include/asm/mmu_context.h
+++ b/arch/m32r/include/asm/mmu_context.h
@@ -135,7 +135,7 @@ static inline void switch_mm(struct mm_struct *prev,
}
#ifdef CONFIG_SMP
else
- if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next))
+ if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)))
activate_context(next);
#endif /* CONFIG_SMP */
}
diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c
index e6ec3cc..1b7598e 100644
--- a/arch/m32r/kernel/smp.c
+++ b/arch/m32r/kernel/smp.c
@@ -469,7 +469,7 @@ void smp_invalidate_interrupt(void)
if (flush_mm == current->active_mm)
activate_context(flush_mm);
else
- cpumask_clear(cpu_id, mm_cpumask(flush_mm));
+ cpumask_clear_cpu(cpu_id, mm_cpumask(flush_mm));
} else {
unsigned long va = flush_va;
--
1.6.4.4
At Fri, 12 Jun 2009 22:33:14 +0930,
Rusty Russell wrote:
>
>
> Makes code futureproof against the impending change to mm->cpu_vm_mask.
>
> It's also a chance to use the new cpumask_ ops which take a pointer
> (the older ones are deprecated, but there's no hurry for arch code).
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> ---
> arch/m32r/include/asm/mmu_context.h | 4 ++--
> arch/m32r/kernel/smp.c | 8 ++++----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c
> --- a/arch/m32r/kernel/smp.c
> +++ b/arch/m32r/kernel/smp.c
> @@ -264,7 +264,7 @@ void smp_flush_tlb_mm(struct mm_struct *
> preempt_disable();
> cpu_id = smp_processor_id();
> mmc = &mm->context[cpu_id];
> - cpu_mask = mm->cpu_vm_mask;
> + cpu_mask = *mm_cpumask(mm);
> cpu_clear(cpu_id, cpu_mask);
>
> if (*mmc != NO_CONTEXT) {
> @@ -273,7 +273,7 @@ void smp_flush_tlb_mm(struct mm_struct *
> if (mm == current->mm)
> activate_context(mm);
> else
> - cpu_clear(cpu_id, mm->cpu_vm_mask);
> + cpumask_clear_cpu(cpu_id, mm_cpumask(mm));
> local_irq_restore(flags);
> }
> if (!cpus_empty(cpu_mask))
> @@ -334,7 +334,7 @@ void smp_flush_tlb_page(struct vm_area_s
> preempt_disable();
> cpu_id = smp_processor_id();
> mmc = &mm->context[cpu_id];
> - cpu_mask = mm->cpu_vm_mask;
> + cpu_mask = *mm_cpumask(mm);
> cpu_clear(cpu_id, cpu_mask);
>
> #ifdef DEBUG_SMP
> @@ -469,7 +469,7 @@ void smp_invalidate_interrupt(void)
> if (flush_mm == current->active_mm)
> activate_context(flush_mm);
> else
> - cpu_clear(cpu_id, flush_mm->cpu_vm_mask);
> + cpumask_clear(cpu_id, mm_cpumask(flush_mm));
> } else {
> unsigned long va = flush_va;
>
> diff --git a/arch/m32r/include/asm/mmu_context.h b/arch/m32r/include/asm/mmu_context.h
> --- a/arch/m32r/include/asm/mmu_context.h
> +++ b/arch/m32r/include/asm/mmu_context.h
> @@ -127,7 +127,7 @@ static inline void switch_mm(struct mm_s
>
> if (prev != next) {
> #ifdef CONFIG_SMP
> - cpu_set(cpu, next->cpu_vm_mask);
> + cpumask_set_cpu(cpu, mm_cpumask(next));
> #endif /* CONFIG_SMP */
> /* Set MPTB = next->pgd */
> *(volatile unsigned long *)MPTB = (unsigned long)next->pgd;
> @@ -135,7 +135,7 @@ static inline void switch_mm(struct mm_s
> }
> #ifdef CONFIG_SMP
> else
> - if (!cpu_test_and_set(cpu, next->cpu_vm_mask))
> + if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next))
> activate_context(next);
> #endif /* CONFIG_SMP */
> }
>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 8/13] cpumask: use mm_cpumask() wrapper: m32r
2009-09-23 13:29 ` Hirokazu Takata
@ 2009-09-24 0:05 ` Rusty Russell
0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2009-09-24 0:05 UTC (permalink / raw)
To: Hirokazu Takata; +Cc: linux-kernel
On Wed, 23 Sep 2009 10:59:01 pm Hirokazu Takata wrote:
> Hello,
>
> I apologize for my too late reply.
>
> I've checked the patch and fixed two typos.
Thanks! This has been in linux-next for about two cycles, and I am
about to finally push to Linus.
Cheers,
Rusty.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-24 0:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12 13:03 [PATCH 8/13] cpumask: use mm_cpumask() wrapper: m32r Rusty Russell
2009-09-23 13:29 ` Hirokazu Takata
2009-09-24 0:05 ` Rusty Russell
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.