diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-09-23 07:21:42 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-09-23 07:21:42 +0200 |
commit | 62731433591156ece255e23ffd69ea4544b424f1 (patch) | |
tree | 125ce584cdb3166456b1767d03c3d5e72ea79a6e /kernel/cpu.c | |
parent | 7c9a3730a5ef4c6240eaaa2d8dcdb8cc1627d715 (diff) | |
parent | dd56af42bd829c6e770ed69812bd65a04eaeb1e4 (diff) | |
download | op-kernel-dev-62731433591156ece255e23ffd69ea4544b424f1.zip op-kernel-dev-62731433591156ece255e23ffd69ea4544b424f1.tar.gz |
Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu
Pull the v3.18 RCU changes from Paul E. McKenney:
"
* Update RCU documentation. These were posted to LKML at
https://lkml.org/lkml/2014/8/28/378.
* Miscellaneous fixes. These were posted to LKML at
https://lkml.org/lkml/2014/8/28/386. An additional fix that
eliminates a documented (but now inconvenient) deadlock between
RCU hotplug and expedited grace periods was posted at
https://lkml.org/lkml/2014/8/28/573.
* Changes related to No-CBs CPUs and NO_HZ_FULL. These were posted
to LKML at https://lkml.org/lkml/2014/8/28/412.
* Torture-test updates. These were posted to LKML at
https://lkml.org/lkml/2014/8/28/546 and at
https://lkml.org/lkml/2014/9/11/1114.
* RCU-tasks implementation. These were posted to LKML at
https://lkml.org/lkml/2014/8/28/540.
"
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r-- | kernel/cpu.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 81e2a38..356450f 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -79,6 +79,8 @@ static struct { /* Lockdep annotations for get/put_online_cpus() and cpu_hotplug_begin/end() */ #define cpuhp_lock_acquire_read() lock_map_acquire_read(&cpu_hotplug.dep_map) +#define cpuhp_lock_acquire_tryread() \ + lock_map_acquire_tryread(&cpu_hotplug.dep_map) #define cpuhp_lock_acquire() lock_map_acquire(&cpu_hotplug.dep_map) #define cpuhp_lock_release() lock_map_release(&cpu_hotplug.dep_map) @@ -91,10 +93,22 @@ void get_online_cpus(void) mutex_lock(&cpu_hotplug.lock); cpu_hotplug.refcount++; mutex_unlock(&cpu_hotplug.lock); - } EXPORT_SYMBOL_GPL(get_online_cpus); +bool try_get_online_cpus(void) +{ + if (cpu_hotplug.active_writer == current) + return true; + if (!mutex_trylock(&cpu_hotplug.lock)) + return false; + cpuhp_lock_acquire_tryread(); + cpu_hotplug.refcount++; + mutex_unlock(&cpu_hotplug.lock); + return true; +} +EXPORT_SYMBOL_GPL(try_get_online_cpus); + void put_online_cpus(void) { if (cpu_hotplug.active_writer == current) |