qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] rcu: Introduce force_rcu notifier


From: Paolo Bonzini
Subject: Re: [PATCH 1/2] rcu: Introduce force_rcu notifier
Date: Mon, 18 Oct 2021 11:17:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

On 15/10/21 18:12, Greg Kurz wrote:
+/*
+ * NotifierList used to force an RCU grace period.  Accessed under
+ * rcu_registry_lock.
+ */
+static NotifierList force_rcu_notifiers =
+    NOTIFIER_LIST_INITIALIZER(force_rcu_notifiers);
+
  /*
   * Check whether a quiescent state was crossed between the beginning of
   * update_counter_and_wait and now.
@@ -107,6 +115,8 @@ static void wait_for_readers(void)
                   * get some extra futex wakeups.
                   */
                  qatomic_set(&index->waiting, false);
+            } else if (qatomic_read(&in_drain_call_rcu)) {
+                notifier_list_notify(&force_rcu_notifiers, NULL);
              }
          }

You can put the notifier in struct rcu_reader_data---this way it doesn't call all the notifiers but only those that are necessary to make progress.

While at it, I have a slight preference for a separate rcu_add_force_rcu_notifier API, but I can be convinced otherwise. :)

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]