Re: [PATCH 2.6.15-rc2] Fxi hardcoded cpu=0 in workqueue for per_cpu_ptr() calls

From: Herbert Xu
Date: Thu Nov 24 2005 - 21:50:24 EST


Ben Collins <bcollins@xxxxxxxxxx> wrote:
> Tracked this down on an Ultra Enterprise 3000. It's a 6-way machine. Odd
> thing about this machine (and it's good for finding bugs like this) is
> that the CPU id's are not 0 based. For instance, on my machine the CPU's
> are 6/7/10/11/14/15.

Good catch.

> I changed the 0's to any_online_cpu(cpu_online_mask), which cpumask.h
> claims is "First cpu in mask". So this fits the same usage.

any_online_cpu(cpu_online_mask) is a bit of a tautology. How about
first_cpu(cpu_online_mask)? In fact, I'd prefer a new macro altogether
which you can then define to zero on UP.

This patch raises an interesting question actually. What happens
when the CPU that's designated to run single-threaded wq's gets
removed?

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
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/