x86: uv cleanup
Hi Tejun,
I appreciate your consolidation and cleanup of the UV code, relative to 32 vs 64.
I have a question about the addition of the
WARN_ON(!in_atomic());
in uv_flush_tlb_others().
The patch is
http://marc.info/?l=linux-kernel&m=123252788121855&w=2
I expect this function to always entered preemptable. Could you explain a bit about your thought behind this WARN_ON?
Thanks.
-Cliff
const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
struct mm_struct *mm, unsigned long va, unsigned int cpu)
{
static DEFINE_PER_CPU(cpumask_t, flush_tlb_mask);
struct cpumask *flush_mask = &__get_cpu_var(flush_tlb_mask);
int i;
int bit;
int blade;
int uv_cpu;
int this_blade;
int locals = 0;
struct bau_desc *bau_desc;
WARN_ON(!in_atomic());
cpumask_andnot(flush_mask, cpumask, cpumask_of(cpu));
uv_cpu = uv_blade_processor_id();
this_blade = uv_numa_blade_id();Quoted 11 lines · Cliff Wickman
I appreciate your consolidation and cleanup of the UV code, relative to 32 vs 64.
I have a question about the addition of the
WARN_ON(!in_atomic());in
uv_flush_tlb_others().
The patch is
http://marc.info/?l=linux-kernel&m=123252788121855&w=2I expect this function to always entered preemptable. Could you explain a bit about your thought behind this
WARN_ON?
The function needs to return modified cpumask. Before the patch, this was achieved by the caller disabling preemption and pass modifiable per-cpu cpumask and allowing uv code to modify it in place. After the patch, to put uv code in uv proper (so that the generic code doesn't have to allocate percpu cpumask for it), this is moved into the uv function. The caller disables preemtion and uses the returned cpumask which might or might not be the same array it gave to the function and the array is guaranteed to be valid until preemption is re-enabled. The meachnism itself isn't different. Only what's done where has changed to make it more modular. More specifically, when uv is not needed, the generic code can simply omit the uv related part including the percpu cpumask allocation.
Thanks.
Signature · 1 line
tejun