Merge branch 'linus' into tracing/core
authorIngo Molnar <mingo@elte.hu>
Thu, 8 Apr 2010 07:06:12 +0000 (09:06 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 8 Apr 2010 08:18:47 +0000 (10:18 +0200)
Conflicts:
include/linux/module.h
kernel/module.c

Semantic conflict:
include/trace/events/module.h

Merge reason: Resolve the conflict with upstream commit 5fbfb18 ("Fix up
              possibly racy module refcounting")

Signed-off-by: Ingo Molnar <mingo@elte.hu>
1  2 
include/linux/module.h
include/trace/events/module.h
kernel/module.c
kernel/trace/ring_buffer.c
kernel/trace/trace.c
kernel/trace/trace_functions_graph.c
kernel/trace/trace_selftest.c

@@@ -459,8 -464,9 +464,8 @@@ static inline void __module_get(struct 
  {
        if (module) {
                preempt_disable();
-               __this_cpu_inc(module->refptr->count);
+               __this_cpu_inc(module->refptr->incs);
 -              trace_module_get(module, _THIS_IP_,
 -                               __this_cpu_read(module->refptr->incs));
 +              trace_module_get(module, _THIS_IP_);
                preempt_enable();
        }
  }
@@@ -473,10 -479,10 +478,9 @@@ static inline int try_module_get(struc
                preempt_disable();
  
                if (likely(module_is_live(module))) {
-                       __this_cpu_inc(module->refptr->count);
+                       __this_cpu_inc(module->refptr->incs);
 -                      trace_module_get(module, _THIS_IP_,
 -                              __this_cpu_read(module->refptr->incs));
 +                      trace_module_get(module, _THIS_IP_);
-               }
-               else
+               } else
                        ret = 0;
  
                preempt_enable();
@@@ -68,7 -65,7 +68,7 @@@ DECLARE_EVENT_CLASS(module_refcnt
  
        TP_fast_assign(
                __entry->ip     = ip;
-               __entry->refcnt = __this_cpu_read(mod->refptr->count);
 -              __entry->refcnt = refcnt;
++              __entry->refcnt = __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs);
                __assign_str(name, mod->name);
        ),
  
diff --cc kernel/module.c
@@@ -799,9 -864,11 +865,10 @@@ void module_put(struct module *module
  {
        if (module) {
                preempt_disable();
-               __this_cpu_dec(module->refptr->count);
+               smp_wmb(); /* see comment in module_refcount */
+               __this_cpu_inc(module->refptr->decs);
  
 -              trace_module_put(module, _RET_IP_,
 -                               __this_cpu_read(module->refptr->decs));
 +              trace_module_put(module, _RET_IP_);
                /* Maybe they're waiting for us to drop reference? */
                if (unlikely(!module_is_live(module)))
                        wake_up_process(module->waiter);
Simple merge
Simple merge
Simple merge
Simple merge