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

index 393ec39b580a5519891cf883bfd68ee9e8c9ffff,515d53ae6a795e9b73bbf0388aa8966be1014924..6914fcad46733974df83c76c5d7e2d96008793be
@@@ -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();
index f07b44a2b240b90c1b985a95c400bbd634160cee,4b0f48ba16a688da9ead5b901604419c7823ea3b..c7bb2f0482fec377b1f67edd661d6331441fe7c3
@@@ -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
index d9e237926b69e6eb0ce395769f9bb2b506eb8f9c,1016b75b026ab61b7ef0ee233915c3b1adeaf64d..b8a1e313448cba8b0476d7d500dcc02cf1c1ae20
@@@ -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