Re: [this_cpu_xx V7 7/8] Module handling: Use this_cpu_xx todynamically allocate counters

From: Christoph Lameter
Date: Wed Dec 16 2009 - 11:12:10 EST


Fixup patch:

Subject: Extend preempt_disable section around module_is_live()

Signed-off-by: Christoph Lameter <cl@xxxxxxxxxxxxxxxxxxxx>

---
include/linux/module.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6/include/linux/module.h
===================================================================
--- linux-2.6.orig/include/linux/module.h 2009-12-16 08:57:37.000000000 -0600
+++ linux-2.6/include/linux/module.h 2009-12-16 08:58:09.000000000 -0600
@@ -467,15 +467,17 @@ static inline int try_module_get(struct
int ret = 1;

if (module) {
+ preempt_disable();
+
if (likely(module_is_live(module))) {
- preempt_disable();
__this_cpu_inc(module->refptr->count);
trace_module_get(module, _THIS_IP_,
__this_cpu_read(module->refptr->count));
- preempt_enable();
}
else
ret = 0;
+
+ preempt_enable();
}
return ret;
}
--
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/