linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: tglx@linutronix.de, linux-rt-users@vger.kernel.org
Cc: Mike Snitzer <msnitzer@redhat.com>,
	Nikos Tsironis <ntsironis@arrikto.com>,
	Scott Wood <swood@redhat.com>,
	Ilias Tsitsimpis <iliastsi@arrikto.com>,
	dm-devel@redhat.com, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Daniel Wagner <dwagner@suse.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: [PATCH RT 2/2 v3] list_bl: avoid BUG when the list is not locked
Date: Wed, 13 Nov 2019 06:18:08 -0500 (EST)	[thread overview]
Message-ID: <alpine.LRH.2.02.1911130616570.20335@file01.intranet.prod.int.rdu2.redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1911121110430.12815@file01.intranet.prod.int.rdu2.redhat.com>

list_bl would crash with BUG() if we used it without locking. dm-snapshot 
uses its own locking on realtime kernels (it can't use list_bl because 
list_bl uses raw spinlock and dm-snapshot takes other non-raw spinlocks 
while holding bl_lock).

To avoid this BUG, we must set LIST_BL_LOCKMASK = 0.

This patch is intended only for the realtime kernel patchset, not for the 
upstream kernel.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 include/linux/list_bl.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-rt-devel/include/linux/list_bl.h
===================================================================
--- linux-rt-devel.orig/include/linux/list_bl.h	2019-11-13 12:15:50.000000000 +0100
+++ linux-rt-devel/include/linux/list_bl.h	2019-11-13 12:15:50.000000000 +0100
@@ -19,7 +19,7 @@
  * some fast and compact auxiliary data.
  */
 
-#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+#if (defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)) && !defined(CONFIG_PREEMPT_RT_BASE)
 #define LIST_BL_LOCKMASK	1UL
 #else
 #define LIST_BL_LOCKMASK	0UL


  parent reply	other threads:[~2019-11-13 11:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 16:16 [PATCH RT 2/2 v2] list_bl: avoid BUG when the list is not locked Mikulas Patocka
2019-11-13 10:29 ` Nikos Tsironis
2019-11-13 11:16   ` Mikulas Patocka
2019-11-13 11:50     ` Nikos Tsironis
2019-11-13 12:05       ` Mikulas Patocka
2019-11-13 11:18 ` Mikulas Patocka [this message]
2019-11-13 13:10 ` [PATCH RT 2/2 v4] " Nikos Tsironis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.02.1911130616570.20335@file01.intranet.prod.int.rdu2.redhat.com \
    --to=mpatocka@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=dm-devel@redhat.com \
    --cc=dwagner@suse.de \
    --cc=iliastsi@arrikto.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=msnitzer@redhat.com \
    --cc=ntsironis@arrikto.com \
    --cc=swood@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).