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

Srivatsa Vaddagiri
2004-04-01T05:03:08Z

On Thu, Apr 01, 2004 at 01:31:15AM +0000, Andy Whitcroft wrote:
> spin_lock(&tlbstate_lock);
> +
> + /* Subtle, mask the request mask with the currently online cpu's.
> + * Sample this under the lock; cpus in the the middle of going
> + * offline will wait until there is noone in this critical section
> + * before disabling IPI handling. */
> + cpus_and(tmp, cpumask, cpu_online_map);
> + if(cpus_empty(tmp))
> + return;

Hmm ..Doesn't it need to drop tlbstate_lock before returning?

> + /* Subtle, IPI users assume that they will be able to get IPI's
> + * though to the cpus listed in cpu_online_map. To ensure this
> + * we add the requirement that they check cpu_online_map within
> + * the IPI critical sections. Here we remove ourselves from the
> + * map, then ensure that all other cpus have left the relevant
> + * critical sections since the change. We do this by aquiring
> + * the relevant section locks, if we have them none else is in
> + * them. Once this is done we can go offline. */
> + spin_lock(&tlbstate_lock);
> + spin_unlock(&tlbstate_lock);
> + spin_lock(&tlbstate_lock);
> + spin_unlock(&tlbstate_lock);

The second lock should be call_lock?

--

Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017