diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-01 13:49:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-01 13:49:25 -0400 |
commit | 02201e3f1b46aed7c6348f406b7b40de80ba6de3 (patch) | |
tree | 2392c9098359725c195dd82a72b20ccedc1a1509 /include/linux/compiler.h | |
parent | 0890a264794f33df540fbaf274699146903b4e6b (diff) | |
parent | 20bdc2cfdbc484777b30b96fcdbb8994038f3ce1 (diff) |
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module updates from Rusty Russell:
"Main excitement here is Peter Zijlstra's lockless rbtree optimization
to speed module address lookup. He found some abusers of the module
lock doing that too.
A little bit of parameter work here too; including Dan Streetman's
breaking up the big param mutex so writing a parameter can load
another module (yeah, really). Unfortunately that broke the usual
suspects, !CONFIG_MODULES and !CONFIG_SYSFS, so those fixes were
appended too"
* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (26 commits)
modules: only use mod->param_lock if CONFIG_MODULES
param: fix module param locks when !CONFIG_SYSFS.
rcu: merge fix for Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE()
module: add per-module param_lock
module: make perm const
params: suppress unused variable error, warn once just in case code changes.
modules: clarify CONFIG_MODULE_COMPRESS help, suggest 'N'.
kernel/module.c: avoid ifdefs for sig_enforce declaration
kernel/workqueue.c: remove ifdefs over wq_power_efficient
kernel/params.c: export param_ops_bool_enable_only
kernel/params.c: generalize bool_enable_only
kernel/module.c: use generic module param operaters for sig_enforce
kernel/params: constify struct kernel_param_ops uses
sysfs: tightened sysfs permission checks
module: Rework module_addr_{min,max}
module: Use __module_address() for module_address_lookup()
module: Make the mod_tree stuff conditional on PERF_EVENTS || TRACING
module: Optimize __module_address() using a latched RB-tree
rbtree: Implement generic latch_tree
seqlock: Introduce raw_read_seqcount_latch()
...
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r-- | include/linux/compiler.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 26fc8bc77f85..7f8ad9593da7 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -475,6 +475,21 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s | |||
475 | (volatile typeof(x) *)&(x); }) | 475 | (volatile typeof(x) *)&(x); }) |
476 | #define ACCESS_ONCE(x) (*__ACCESS_ONCE(x)) | 476 | #define ACCESS_ONCE(x) (*__ACCESS_ONCE(x)) |
477 | 477 | ||
478 | /** | ||
479 | * lockless_dereference() - safely load a pointer for later dereference | ||
480 | * @p: The pointer to load | ||
481 | * | ||
482 | * Similar to rcu_dereference(), but for situations where the pointed-to | ||
483 | * object's lifetime is managed by something other than RCU. That | ||
484 | * "something other" might be reference counting or simple immortality. | ||
485 | */ | ||
486 | #define lockless_dereference(p) \ | ||
487 | ({ \ | ||
488 | typeof(p) _________p1 = READ_ONCE(p); \ | ||
489 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ | ||
490 | (_________p1); \ | ||
491 | }) | ||
492 | |||
478 | /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ | 493 | /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ |
479 | #ifdef CONFIG_KPROBES | 494 | #ifdef CONFIG_KPROBES |
480 | # define __kprobes __attribute__((__section__(".kprobes.text"))) | 495 | # define __kprobes __attribute__((__section__(".kprobes.text"))) |