Greg Kurz fceaefb43f rcu: Introduce force_rcu notifier
The drain_rcu_call() function can be blocked as long as an RCU reader
stays in a read-side critical section. This is typically what happens
when a TCG vCPU is executing a busy loop. It can deadlock the QEMU
monitor as reported in https://gitlab.com/qemu-project/qemu/-/issues/650 .

This can be avoided by allowing drain_rcu_call() to enforce an RCU grace
period. Since each reader might need to do specific actions to end a
read-side critical section, do it with notifiers.

Prepare ground for this by adding a notifier list to the RCU reader
struct and use it in wait_for_readers() if drain_rcu_call() is in
progress. An API is added for readers to register their notifiers.

This is largely based on a draft from Paolo Bonzini.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211109183523.47726-2-groug@kaod.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit ef149763a8fcce70b85dfda27cc1222ecf765750)
Signed-off-by: Michael Roth <michael.roth@amd.com>
2021-12-14 14:25:55 -06:00
..
2020-11-03 09:42:52 -05:00
2020-12-10 12:15:18 -05:00
2020-01-06 18:41:32 +04:00
2016-06-07 18:19:23 +03:00
2017-10-16 20:57:13 +03:00
2020-10-15 16:06:27 +02:00
2019-09-11 08:46:17 +02:00
2020-12-10 17:16:44 +01:00
2021-07-06 08:33:51 +02:00
2021-07-09 18:19:00 +02:00
2018-09-26 08:55:54 -07:00
2019-04-18 22:18:59 +02:00
2019-08-16 13:31:52 +02:00
2021-12-14 14:25:55 -06:00
2018-01-16 14:54:50 +01:00
2016-02-23 12:43:05 +00:00
2021-04-30 12:27:47 +02:00
2018-08-24 20:26:37 +02:00
2016-09-15 15:32:22 +03:00
2017-01-24 23:26:52 +03:00
2021-04-01 15:27:44 +04:00