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

Re: [Xen-devel] [PATCH v6 3/4] xen/rcu: add assertions to debug build


  • To: Jürgen Groß <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 Mar 2020 08:37:27 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6tgiRTbrcF2OkICiqUrKGpanjybbNjBbpeHFfaLUE50=; b=fKxtqOMzgGn4IbFb5wVXzyHm+gl4WkVWNQ1MW7U1T45s5NPY0SCdPDTTyJpVhs24naTZ+SuEUL6ZhE6mC6EYt+nyILGsZObOHq48HcxkkSGE4wXPa5iRNvPA5uYVrAWco7UvkMkw7DygzDF95Rd59wwxvltmycu16Wn6toMmKbIr/x5huKYXUhfPprh7uxP1vvw9m/mkn+k0ZCrEisAPx2I+jxrDEsbvtwlsUxvcWfZ8zGNQwHeAwT2NfWuYakS1JRQjoK7XtUCxmiU/F3/wFTYCWLDPvJIqIY/L3gm7wEexhQ9EU3G24pTTqWnDG3FehVK5ylaTh9Uzs0aAvA/pxg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QsxZ348CuOaXbssiteIuebA6S/wvWdoLkR23BPodQ16etHpFfAd+BKyn/q/swTk8yxUUDkk8Qjkz+E9RATwwdu/IaMRsllooYj9hib/OGTX0XbWtPhvEbD7tP8WXo+kd/oAWflVfrNaNS+hcNFC+an1S+PKmcBFwna3JVsPiniVgNl+Ot+Rd3f62kMDSWrAkufRJnmquyHVcgSLViUiwznhKQK5qYlteYBox2JSwf60SrCRZ2jYAc4VgkTz+gkL8upDxshxiRLAkVUCxrbI+4oxbHwtZQEOs9zyN8o4GZLgV8pYlLWrDQ830oIavTBK4ZckCTtgNxUyDyWTC96Dh1g==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 18 Mar 2020 07:44:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.03.2020 07:26, Jürgen Groß wrote:
On 17.03.20 15:36, Jan Beulich wrote:
On 13.03.2020 14:06, Juergen Gross wrote:
Xen's RCU implementation relies on no softirq handling taking place
while being in a RCU critical section. Add ASSERT()s in debug builds
in order to catch any violations.

For that purpose modify rcu_read_[un]lock() to use a dedicated percpu
counter additional to preempt_[en|dis]able() as this enables to test
that condition in __do_softirq() (ASSERT_NOT_IN_ATOMIC() is not
usable there due to __cpu_up() calling process_pending_softirqs()
while holding the cpu hotplug lock).

While at it switch the rcu_read_[un]lock() implementation to static
inline functions instead of macros.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one remark:

@@ -91,16 +114,23 @@ typedef struct _rcu_read_lock rcu_read_lock_t;
   * will be deferred until the outermost RCU read-side critical section
   * completes.
   *
- * It is illegal to block while in an RCU read-side critical section.
+ * It is illegal to process softirqs while in an RCU read-side critical 
section.

The latest with the re-added preempt_disable(), wouldn't this better
say "... to process softirqs or block ..."?

I can add this, but OTOH blocking without processing softirqs is not
possible, as there is no other (legal) way to enter the scheduler.

Sure, but that's still implicit, but could do with saying explicitly.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.