Re: BUG_ON(!cpus_equal(cpumask, tmp));

From: Martin J. Bligh
Date: Tue Mar 30 2004 - 19:24:21 EST


>| We faced this problem starting 2.6.3 while working on kexec.
>|
>| The problem is because we now initialize cpu_vm_mask for init_mm with
>| CPU_MASK_ALL (from 2.6.3 onwards) which makes all bits in cpumask 1 (on SMP).
>| Hence BUG_ON(!cpus_equal(cpumask,tmp) fails. The change to set
>| cpu_vm_mask to CPU_MASK_ALL was done to remove tlb flush optimizations
>| for ppc64.
>|
>| I had posted a patch for this in the earlier thread. Reposting the same
>| here. This patch removes the assertion and uses "tmp" instead of cpumask.
>| Otherwise, we will end up sending IPIs to offline CPUs as well.
>|
>| Comments please.
>
> I'll just say that kexec fails without this patch and works with
> it applied, so I'd like to see it merged. If this patch isn't
> acceptable, let's find out why and try to make one that is.
>
> Thanks for the patch, Hari.

>From discussions with Andy, it seems this still has the same race as before
just smaller. I don't see how we can fix this properly without having some
locking on cpu_online_map .... probably RCU as it's massively read-biased
and we don't want to pay a spinlock cost to read it.

M.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/