* [PATCH 2/2] realtime: avoid BUG when the list is not locked
@ 2019-11-11 13:59 Mikulas Patocka
2019-11-12 9:10 ` [dm-devel] " Daniel Wagner
0 siblings, 1 reply; 5+ messages in thread
From: Mikulas Patocka @ 2019-11-11 13:59 UTC (permalink / raw)
To: Mike Snitzer, Scott Wood; +Cc: dm-devel, Nikos Tsironis, Ilias Tsitsimpis
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)
#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
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-devel] [PATCH 2/2] realtime: avoid BUG when the list is not locked
2019-11-11 13:59 [PATCH 2/2] realtime: avoid BUG when the list is not locked Mikulas Patocka
@ 2019-11-12 9:10 ` Daniel Wagner
2019-11-12 11:21 ` Mikulas Patocka
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Wagner @ 2019-11-12 9:10 UTC (permalink / raw)
To: Mikulas Patocka
Cc: Mike Snitzer, Scott Wood, dm-devel, Nikos Tsironis,
Ilias Tsitsimpis, linux-rt-users, tglx, bigeasy
[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?
> #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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-devel] [PATCH 2/2] realtime: avoid BUG when the list is not locked
2019-11-12 9:10 ` [dm-devel] " Daniel Wagner
@ 2019-11-12 11:21 ` Mikulas Patocka
0 siblings, 0 replies; 5+ messages in thread
From: Mikulas Patocka @ 2019-11-12 11:21 UTC (permalink / raw)
To: Daniel Wagner
Cc: Mike Snitzer, Scott Wood, dm-devel, Nikos Tsironis,
Ilias Tsitsimpis, linux-rt-users, tglx, bigeasy
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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] realtime: avoid BUG when the list is not locked
@ 2019-11-12 11:21 ` Mikulas Patocka
0 siblings, 0 replies; 5+ messages in thread
From: Mikulas Patocka @ 2019-11-12 11:21 UTC (permalink / raw)
To: Daniel Wagner
Cc: Mike Snitzer, linux-rt-users, bigeasy, Ilias Tsitsimpis,
dm-devel, tglx, Scott Wood, Nikos Tsironis
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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-devel] [PATCH 2/2] realtime: avoid BUG when the list is not locked
2019-11-12 11:21 ` Mikulas Patocka
(?)
@ 2019-11-12 11:39 ` Sebastian Andrzej Siewior
-1 siblings, 0 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-11-12 11:39 UTC (permalink / raw)
To: Mikulas Patocka
Cc: Daniel Wagner, Mike Snitzer, Scott Wood, dm-devel,
Nikos Tsironis, Ilias Tsitsimpis, linux-rt-users, tglx
On 2019-11-12 06:21:57 [-0500], Mikulas Patocka wrote:
> > 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.
In that case please repost it and Cc tglx and myself and add the RT tag
after PATCH.
Please make sure it applies and fixes a problem in the latest available
RT kernel. Please state the problem on RT and how it is solved.
> Mikulas
Sebastian
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-11-12 11:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2019-11-12 11:21 ` Mikulas Patocka
2019-11-12 11:39 ` [dm-devel] " Sebastian Andrzej Siewior
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.