powerpc/mm: Optimize detection of thread local mm's
Instead of comparing the whole CPU mask every time, let's keep a counter of how many bits are set in the mask. Thus testing for a local mm only requires testing if that counter is 1 and the current CPU bit is set in the mask. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
b426e4bd77
commit
a619e59c07
@@ -170,6 +170,8 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
|
||||
#ifdef CONFIG_SPAPR_TCE_IOMMU
|
||||
mm_iommu_init(mm);
|
||||
#endif
|
||||
atomic_set(&mm->context.active_cpus, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user