Greatly simplified version of the patches; allocate and dealloc all required structs at module load and unload time.
Clarification: per_cpu(var, cpu) does indeed work for not-present CPUs; the allocations for module specific per-cpu variables are done at module load and unload time, while the per_cpu chunks are setup for all possible CPUs at boot time.