Paul E. McKenney
dd56af42bd
rcu: Eliminate deadlock between CPU hotplug and expedited grace periods
...
Currently, the expedited grace-period primitives do get_online_cpus().
This greatly simplifies their implementation, but means that calls
to them holding locks that are acquired by CPU-hotplug notifiers (to
say nothing of calls to these primitives from CPU-hotplug notifiers)
can deadlock. But this is starting to become inconvenient, as can be
seen here: https://lkml.org/lkml/2014/8/5/754 . The problem in this
case is that some developers need to acquire a mutex from a CPU-hotplug
notifier, but also need to hold it across a synchronize_rcu_expedited().
As noted above, this currently results in deadlock.
This commit avoids the deadlock and retains the simplicity by creating
a try_get_online_cpus(), which returns false if the get_online_cpus()
reference count could not immediately be incremented. If a call to
try_get_online_cpus() returns true, the expedited primitives operate as
before. If a call returns false, the expedited primitives fall back to
normal grace-period operations. This falling back of course results in
increased grace-period latency, but only during times when CPU hotplug
operations are actually in flight. The effect should therefore be
negligible during normal operation.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com >
Cc: Josh Triplett <josh@joshtriplett.org >
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net >
Tested-by: Lan Tianyu <tianyu.lan@intel.com >
2014-09-18 16:22:27 -07:00
..
2014-07-31 13:45:32 -04:00
2014-08-06 18:01:23 -07:00
2014-07-08 15:08:45 +04:00
2014-07-25 15:16:27 -07:00
2014-08-08 15:57:26 -07:00
2014-07-23 10:22:35 +09:00
2014-08-21 07:44:36 -05:00
2014-08-09 09:15:07 -07:00
2014-08-05 17:46:42 -07:00
2014-08-07 23:37:07 -07:00
2014-08-05 17:38:45 -07:00
2014-08-07 17:17:39 -07:00
2014-08-14 11:09:05 -06:00
2014-08-06 09:38:14 -07:00
2014-08-11 11:42:39 +02:00
2014-07-21 19:39:55 -07:00
2014-07-22 12:46:11 +05:30
2014-07-11 14:08:26 +02:00
2014-08-14 09:15:53 -06:00
2014-08-05 18:29:21 +01:00
2014-08-06 09:38:14 -07:00
2014-07-18 13:45:24 -04:00
2014-08-13 18:13:19 -06:00
2014-08-06 09:38:14 -07:00
2014-08-07 14:40:09 -04:00
2014-08-09 09:15:07 -07:00
2014-07-30 10:42:55 -07:00
2014-07-30 15:39:46 -04:00
2014-07-09 16:02:41 +02:00
2014-07-07 21:34:43 -07:00
2014-08-06 18:01:27 -07:00
2014-08-16 19:13:33 -07:00
2014-07-24 21:53:47 +10:00
2014-07-15 11:05:10 -04:00
2014-07-02 16:15:55 -07:00
2014-07-23 15:01:52 -07:00
2014-08-06 18:01:16 -07:00
2014-07-03 11:32:43 +01:00
2014-09-18 16:22:27 -07:00
2014-07-21 13:43:19 +02:00
2014-07-17 16:15:35 -04:00
2014-08-01 22:35:55 +08:00
2014-08-07 14:40:10 -04:00
2014-08-05 15:59:35 -07:00
2014-07-08 13:36:52 -07:00
2014-08-06 18:01:16 -07:00
2014-08-11 07:14:01 -07:00
2014-07-23 16:04:47 +02:00
2014-07-10 18:35:01 +02:00
2014-07-10 18:35:01 +02:00
2014-07-10 18:35:23 +02:00
2014-08-08 15:57:33 -07:00
2014-07-08 13:41:08 -07:00
2014-08-02 15:03:58 -07:00
2014-07-08 15:28:16 -07:00
2014-08-07 14:40:08 -04:00
2014-08-11 11:44:11 -07:00
2014-08-06 18:01:12 -07:00
2014-08-09 17:33:44 -07:00
2014-08-22 13:18:48 -04:00
2014-08-06 18:01:15 -07:00
2014-08-06 18:01:24 -07:00
2014-08-08 17:39:48 -07:00
2014-08-06 18:01:22 -07:00
2014-08-04 10:07:36 +02:00
2014-07-23 10:17:54 -07:00
2014-08-06 18:01:19 -07:00
2014-08-06 18:01:19 -07:00
2014-07-15 04:49:40 -04:00
2014-08-19 10:19:39 -05:00
2014-07-21 12:14:04 +02:00
2014-07-08 16:12:53 -07:00
2014-08-11 12:16:51 -07:00
2014-07-25 11:47:46 -07:00
2014-09-07 16:27:34 -07:00
2014-07-04 12:35:59 +02:00
2014-07-23 12:02:30 +02:00
2014-07-08 09:40:06 +02:00
2014-08-08 15:57:32 -07:00
2014-07-23 16:04:47 +02:00
2014-07-07 21:14:21 -07:00
2014-07-17 13:30:00 +00:00
2014-08-02 15:03:58 -07:00
2014-08-10 21:31:58 -07:00
2014-07-10 11:38:23 -07:00
2014-08-08 15:57:33 -07:00
2014-07-22 21:46:08 +01:00
2014-07-22 21:55:45 +01:00
2014-08-06 18:01:24 -07:00
2014-07-28 14:16:30 -04:00
2014-07-23 10:17:54 -07:00
2014-08-06 14:24:47 +02:00
2014-07-03 12:02:14 -07:00
2014-07-23 10:30:34 -04:00
2014-08-06 18:01:24 -07:00
2014-09-18 16:22:27 -07:00
2014-08-06 18:01:15 -07:00
2014-08-08 15:57:18 -07:00
2014-08-06 18:01:21 -07:00
2014-07-11 18:27:56 -07:00
2014-08-08 15:57:23 -07:00
2014-08-08 15:57:27 -07:00
2014-08-06 18:01:18 -07:00
2014-08-06 18:01:22 -07:00
2014-08-06 18:01:20 -07:00
2014-07-27 20:52:44 +09:30
2014-07-27 20:52:42 +09:30
2014-07-17 22:07:37 +02:00
2014-08-11 11:44:11 -07:00
2014-07-03 16:55:07 -06:00
2014-07-17 12:32:47 +02:00
2014-07-16 12:58:36 +00:00
2014-07-24 01:15:04 -07:00
2014-07-31 21:34:20 -07:00
2014-07-12 18:41:25 -04:00
2014-08-03 17:14:13 -04:00
2014-08-22 18:04:43 -04:00
2014-07-12 18:41:25 -04:00
2014-07-22 15:05:06 -07:00
2014-08-06 18:01:21 -07:00
2014-07-29 18:08:50 -07:00
2014-07-23 12:02:30 +02:00
2014-07-26 00:21:41 +05:30
2014-07-29 21:26:45 -06:00
2014-07-07 13:33:46 +01:00
2014-08-01 12:22:21 -06:00
2014-08-11 14:06:23 +01:00
2014-07-09 14:58:37 +01:00
2014-07-21 23:32:51 -07:00
2014-07-29 12:38:07 +02:00
2014-08-06 18:01:21 -07:00
2014-07-16 13:28:05 +02:00
2014-08-08 15:57:18 -07:00
2014-08-06 18:01:17 -07:00
2014-08-06 18:01:20 -07:00
2014-07-10 16:49:15 -06:00
2014-07-23 01:00:45 +02:00
2014-08-04 17:32:24 -07:00
2014-07-09 14:58:37 +01:00
2014-08-04 10:09:27 -07:00
2014-07-30 20:00:21 -07:00
2014-08-04 10:07:11 -07:00
2014-07-08 15:31:26 -07:00
2014-07-23 01:00:36 +02:00
2014-07-18 23:40:23 +02:00
2014-08-13 15:13:44 +10:00
2014-07-07 16:57:18 -07:00
2014-07-03 17:27:23 -07:00
2014-07-15 22:40:22 +02:00
2014-08-06 18:01:24 -07:00
2014-09-16 13:41:44 -07:00
2014-09-07 16:27:35 -07:00
2014-07-25 19:01:53 +01:00
2014-07-08 13:41:08 -07:00
2014-08-14 15:13:39 -07:00
2014-08-08 15:57:24 -07:00
2014-07-10 12:37:33 -07:00
2014-07-16 14:56:55 +02:00
2014-07-16 14:57:13 +02:00
2014-08-08 15:57:26 -07:00
2014-09-07 16:27:34 -07:00
2014-07-18 12:13:40 -07:00
2014-07-30 01:31:46 +10:00
2014-08-05 17:46:42 -07:00
2014-07-08 12:50:59 -07:00
2014-07-17 18:23:35 -07:00
2014-07-17 18:21:21 -07:00
2014-07-23 01:10:45 +02:00
2014-07-09 10:55:57 +02:00
2014-07-02 16:01:51 +02:00
2014-08-08 15:57:26 -07:00
2014-08-08 15:57:31 -07:00
2014-08-06 13:03:44 +02:00
2014-08-11 12:16:51 -07:00
2014-07-31 14:13:29 -07:00
2014-08-08 15:57:17 -07:00
2014-08-08 15:57:32 -07:00
2014-08-08 15:57:24 -07:00
2014-07-22 10:12:05 +08:00
2014-08-04 16:23:30 -07:00
2014-07-23 10:17:53 -07:00
2014-07-23 10:17:54 -07:00
2014-07-30 09:26:25 +02:00
2014-07-23 15:01:55 -07:00
2014-07-18 11:49:57 +02:00
2014-09-16 13:41:06 -07:00
2014-07-29 23:10:56 +02:00
2014-08-06 13:03:43 +02:00
2014-08-07 20:39:36 -04:00
2014-07-10 16:05:19 -07:00
2014-07-11 17:54:28 -07:00
2014-08-07 14:40:11 -04:00
2014-08-08 15:57:22 -07:00
2014-07-09 14:58:37 +01:00
2014-08-08 10:39:16 -06:00
2014-08-06 18:01:19 -07:00
2014-07-16 15:10:41 +02:00
2014-07-16 15:10:39 +02:00
2014-08-06 18:01:23 -07:00
2014-08-08 15:57:26 -07:00
2014-08-06 18:01:23 -07:00