From: Mikulas Patocka <mpatocka@redhat.com> To: Daniel Wagner <dwagner@suse.de> Cc: Mike Snitzer <msnitzer@redhat.com>, Scott Wood <swood@redhat.com>, dm-devel@redhat.com, Nikos Tsironis <ntsironis@arrikto.com>, Ilias Tsitsimpis <iliastsi@arrikto.com>, linux-rt-users@vger.kernel.org, tglx@linutronix.de, bigeasy@linutronix.de Subject: Re: [dm-devel] [PATCH 2/2] realtime: avoid BUG when the list is not locked Date: Tue, 12 Nov 2019 06:21:57 -0500 (EST) [thread overview] Message-ID: <alpine.LRH.2.02.1911120621030.17732@file01.intranet.prod.int.rdu2.redhat.com> (raw) In-Reply-To: <20191112091044.lf7okijocx2wajhk@beryllium.lan> On Tue, 12 Nov 2019, Daniel Wagner wrote: > [cc: linux-user-rt, Thomas and Sebastian] > > On Mon, Nov 11, 2019 at 08:59:44AM -0500, Mikulas Patocka wrote: > > list_bl.h would crash with BUG() if we used it without locking. > > dm-snapshot uses its own locking on readltime kernels, so to avoid this > > BUG, we must set LIST_BL_LOCKMASK = 0. > > > > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> > > > > Index: linux-rt-devel/include/linux/list_bl.h > > =================================================================== > > --- linux-rt-devel.orig/include/linux/list_bl.h 2019-11-07 14:01:51.000000000 +0100 > > +++ linux-rt-devel/include/linux/list_bl.h 2019-11-08 10:12:49.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) > > CONFIG_PREEMPT_RT_BASE is only available in the out of tree -rt patch > set, therefore I assume it's not for mainline, right? Yes - this is intended to be applied to the realtime patchset. Mikulas > > #define LIST_BL_LOCKMASK 1UL > > #else > > #define LIST_BL_LOCKMASK 0UL > > @@ -161,9 +161,6 @@ static inline void hlist_bl_lock(struct > > bit_spin_lock(0, (unsigned long *)b); > > #else > > raw_spin_lock(&b->lock); > > -#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) > > - __set_bit(0, (unsigned long *)b); > > -#endif > > #endif > > } > > > > @@ -172,9 +169,6 @@ static inline void hlist_bl_unlock(struc > > #ifndef CONFIG_PREEMPT_RT_BASE > > __bit_spin_unlock(0, (unsigned long *)b); > > #else > > -#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) > > - __clear_bit(0, (unsigned long *)b); > > -#endif > > raw_spin_unlock(&b->lock); > > #endif > > } > > > > -- > > dm-devel mailing list > > dm-devel@redhat.com > > https://www.redhat.com/mailman/listinfo/dm-devel > > > > Thanks, > Daniel >
WARNING: multiple messages have this Message-ID (diff)
From: Mikulas Patocka <mpatocka@redhat.com> To: Daniel Wagner <dwagner@suse.de> Cc: Mike Snitzer <msnitzer@redhat.com>, linux-rt-users@vger.kernel.org, bigeasy@linutronix.de, Ilias Tsitsimpis <iliastsi@arrikto.com>, dm-devel@redhat.com, tglx@linutronix.de, Scott Wood <swood@redhat.com>, Nikos Tsironis <ntsironis@arrikto.com> Subject: Re: [PATCH 2/2] realtime: avoid BUG when the list is not locked Date: Tue, 12 Nov 2019 06:21:57 -0500 (EST) [thread overview] Message-ID: <alpine.LRH.2.02.1911120621030.17732@file01.intranet.prod.int.rdu2.redhat.com> (raw) In-Reply-To: <20191112091044.lf7okijocx2wajhk@beryllium.lan> On Tue, 12 Nov 2019, Daniel Wagner wrote: > [cc: linux-user-rt, Thomas and Sebastian] > > On Mon, Nov 11, 2019 at 08:59:44AM -0500, Mikulas Patocka wrote: > > list_bl.h would crash with BUG() if we used it without locking. > > dm-snapshot uses its own locking on readltime kernels, so to avoid this > > BUG, we must set LIST_BL_LOCKMASK = 0. > > > > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> > > > > Index: linux-rt-devel/include/linux/list_bl.h > > =================================================================== > > --- linux-rt-devel.orig/include/linux/list_bl.h 2019-11-07 14:01:51.000000000 +0100 > > +++ linux-rt-devel/include/linux/list_bl.h 2019-11-08 10:12:49.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) > > CONFIG_PREEMPT_RT_BASE is only available in the out of tree -rt patch > set, therefore I assume it's not for mainline, right? Yes - this is intended to be applied to the realtime patchset. Mikulas > > #define LIST_BL_LOCKMASK 1UL > > #else > > #define LIST_BL_LOCKMASK 0UL > > @@ -161,9 +161,6 @@ static inline void hlist_bl_lock(struct > > bit_spin_lock(0, (unsigned long *)b); > > #else > > raw_spin_lock(&b->lock); > > -#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) > > - __set_bit(0, (unsigned long *)b); > > -#endif > > #endif > > } > > > > @@ -172,9 +169,6 @@ static inline void hlist_bl_unlock(struc > > #ifndef CONFIG_PREEMPT_RT_BASE > > __bit_spin_unlock(0, (unsigned long *)b); > > #else > > -#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) > > - __clear_bit(0, (unsigned long *)b); > > -#endif > > raw_spin_unlock(&b->lock); > > #endif > > } > > > > -- > > dm-devel mailing list > > dm-devel@redhat.com > > https://www.redhat.com/mailman/listinfo/dm-devel > > > > Thanks, > Daniel >
next prev parent reply other threads:[~2019-11-12 11:22 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-11-11 13:59 [PATCH 2/2] realtime: avoid BUG when the list is not locked Mikulas Patocka 2019-11-12 9:10 ` [dm-devel] " Daniel Wagner 2019-11-12 11:21 ` Mikulas Patocka [this message] 2019-11-12 11:21 ` Mikulas Patocka 2019-11-12 11:39 ` [dm-devel] " Sebastian Andrzej Siewior
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.1911120621030.17732@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-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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.