Re: [PATCH 1/2] kvm: use modern cpumask primitives, no cpumask_ton stack

From: Avi Kivity
Date: Mon Dec 08 2008 - 04:49:59 EST


Rusty Russell wrote:
Btw, for the general case, instead of forcing everyone to duplicate, how about:

cpumask_var_t cpus;

with_cpumask(cpus) {
... code to populate cpus
smp_call_function_some(...);
} end_with_cpumask(cpus);

Where with_cpumask() allocates cpus, and uses a mutex + static fallback on failure.

I'd prefer not to hide deadlocks that way :(

I'll re-battle with that code to neaten it. There are only a few places
which have these kind of issues.


cpuvar_get_maybe_mutex_lock(...);
...
cpuvar_put_maybe_mutex_unlock(...);

?

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
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/