History

modules: use raw_cpu_write for initialization of per cpu refcount.

The initialization of a structure is not subject to synchronization. The use of __this_cpu would trigger a false positive with the additional preemption checks for __this_cpu ops. So simply disable the check through the use of raw_cpu ops. Trace: __this_cpu_write operation in preemptible [00000000] code: modprobe/286 caller is __this_cpu_preempt_check+0x38/0x60 CPU: 3 PID: 286 Comm: modprobe Tainted: GF 3.12.0-rc4+ #187 Call Trace: dump_stack+0x4e/0x82 check_preemption_disabled+0xec/0x110 __this_cpu_preempt_check+0x38/0x60 load_module+0xcfd/0x2650 SyS_init_module+0xa6/0xd0 tracesys+0xe1/0xe6

Christoph Lameter committed 12 years ago

Commit 08f141d1 parent dc322a91 file · +1 −1Browse files

Unified · Split

kernel/module.c+1−1
@@ -640,7 +640,7 @@ static int module_unload_init(struct module *mod) · 639 unmodified lines
640640 INIT_LIST_HEAD(&mod->target_list);
641641
642642 /* Hold reference count during initialization. */
643− __this_cpu_write(mod->refptr->incs, 1);
643+ raw_cpu_write(mod->refptr->incs, 1);
644644
645645 return 0;
646646 }