summaryrefslogtreecommitdiffstats
path: root/include/linux/module.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-04-08 09:06:12 +0200
committerIngo Molnar <mingo@elte.hu>2010-04-08 10:18:47 +0200
commitc1ab9cab75098924fa8226a8a371de66977439df (patch)
tree767e77302ca8f2eb781c60624bc8518cd50ba6eb /include/linux/module.h
parentff0ff84a0767df48d728c36510365344a7e7d582 (diff)
parentf5284e7635787224dda1a2bf82a4c56b1c75671f (diff)
downloadop-kernel-dev-c1ab9cab75098924fa8226a8a371de66977439df.zip
op-kernel-dev-c1ab9cab75098924fa8226a8a371de66977439df.tar.gz
Merge branch 'linus' into tracing/core
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>
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 393ec39..6914fca 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -330,8 +330,11 @@ struct module
struct module_notes_attrs *notes_attrs;
#endif
+#ifdef CONFIG_SMP
/* Per-cpu data. */
- void *percpu;
+ void __percpu *percpu;
+ unsigned int percpu_size;
+#endif
/* The command line arguments (may be mangled). People like
keeping pointers to this stuff */
@@ -365,7 +368,8 @@ struct module
void (*exit)(void);
struct module_ref {
- int count;
+ unsigned int incs;
+ unsigned int decs;
} __percpu *refptr;
#endif
@@ -392,6 +396,7 @@ static inline int module_is_live(struct module *mod)
struct module *__module_text_address(unsigned long addr);
struct module *__module_address(unsigned long addr);
bool is_module_address(unsigned long addr);
+bool is_module_percpu_address(unsigned long addr);
bool is_module_text_address(unsigned long addr);
static inline int within_module_core(unsigned long addr, struct module *mod)
@@ -459,7 +464,7 @@ static inline void __module_get(struct module *module)
{
if (module) {
preempt_disable();
- __this_cpu_inc(module->refptr->count);
+ __this_cpu_inc(module->refptr->incs);
trace_module_get(module, _THIS_IP_);
preempt_enable();
}
@@ -473,10 +478,9 @@ static inline int try_module_get(struct module *module)
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_);
- }
- else
+ } else
ret = 0;
preempt_enable();
@@ -561,6 +565,11 @@ static inline bool is_module_address(unsigned long addr)
return false;
}
+static inline bool is_module_percpu_address(unsigned long addr)
+{
+ return false;
+}
+
static inline bool is_module_text_address(unsigned long addr)
{
return false;
OpenPOWER on IntegriCloud