v5.15-rc2-rt3
Subsystems (9)
Dear RT folks!
I'm pleased to announce the v5.15-rc2-rt3 patch set.
Changes since v5.15-rc2-rt2:
- Remove kernel_fpu_resched(). A few ciphers were restructured and this function has no users and can be removed.
- The cpuset code is using spinlock_t again. Since the mm/slub rework there is need to use raw_spinlock_t.
- Allow to enable CONFIG_RT_GROUP_SCHED on RT again. The original issue can not be reproduced. Please test and report any issue.
- The RCU warning, that has been fixed Valentin Schneider, has been replaced with a patch by Thomas Gleixner. There is another issue open in that area an Frederick Weisbecker is looking into it.
- RCU lock accounting and checking has been reworked by Thomas Gleixner. A direct effect is that might_sleep() produces a warning if invoked in a RCU read section. Previously it would only trigger a warning in schedule() in such a situation.
- The preempt_*_nort() macros have been removed.
- The preempt_enable_no_resched() macro should behave like preempt_enable() on PREEMPT_RT but was was misplaced in v3.14-rt1 and has has been corrected now.
Known issues
- netconsole triggers WARN.
- The "Memory controller" (CONFIG_MEMCG) has been disabled.
- Valentin Schneider reported a few splats on ARM64, see
https://https://lkml.kernel.org/r/.kernel.org/lkml/[email protected]/
The delta patch against v5.15-rc2-rt2 is appended below and can be found here:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/incr/patch-5.15-rc2-rt2-rt3.patch.xz
You can get this release via the git tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git v5.15-rc2-rt3
The RT patch against v5.15-rc2 can be found here:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/older/patch-5.15-rc2-rt3.patch.xz
The split quilt queue is available at:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/older/patches-5.15-rc2-rt3.tar.xz
Sebastian
arch/x86/include/asm/fpu/api.h +0 -1
@@ -28,7 +28,6 @@ extern void kernel_fpu_begin_mask(unsigned int kfpu_mask);extern void kernel_fpu_end (void );extern bool irq_fpu_usable (void );extern void fpregs_mark_activate (void ); -extern void kernel_fpu_resched (void );/* Code that is unaware of kernel_fpu_begin_mask() can use this */ static inline void kernel_fpu_begin (void )
arch/x86/kernel/fpu/core.c +0 -12
@@ -185,18 +185,6 @@ void kernel_fpu_end(void) }EXPORT_SYMBOL_GPL (kernel_fpu_end); -void kernel_fpu_resched (void ) -{ -WARN_ON_FPU (!this_cpu_read (in_kernel_fpu)); - -if (should_resched (PREEMPT_OFFSET )) { -kernel_fpu_end (); -cond_resched (); -kernel_fpu_begin (); - } -} -EXPORT_SYMBOL_GPL (kernel_fpu_resched); -/* * Sync the FPU register state to current's memory register state when the * current task owns the FPU. The hardware register state is preserved.
include/linux/preempt.h +13 -9
@@ -122,9 +122,17 @@* The preempt_count offset after spin_lock() */ #if !defined(CONFIG_PREEMPT_RT ) -#define PREEMPT_LOCK_OFFSET PREEMPT_DISABLE_OFFSET +#define PREEMPT_LOCK_OFFSET PREEMPT_DISABLE_OFFSET +#define PREEMPT_LOCK_RESCHED_OFFSET PREEMPT_LOCK_OFFSET#else -#define PREEMPT_LOCK_OFFSET 0 +/* Locks on RT do not disable preemption */ +#define PREEMPT_LOCK_OFFSET 0 +/* +* spin/rw_lock() on RT implies rcu_read_lock(). The might_sleep() check in +* cond_resched*lock() has to take that into account because it checks for +* preempt_count() + rcu_preempt_depth(). +*/ +#define PREEMPT_LOCK_RESCHED_OFFSET 1#endif /*
@@ -208,12 +216,12 @@ do { \preempt_count_dec (); \ } while (0) -#ifdef CONFIG_PREEMPT_RT +#ifndef CONFIG_PREEMPT_RT # define preempt_enable_no_resched () sched_preempt_enable_no_resched() -# define preempt_check_resched_rt () preempt_check_resched() +# define preempt_check_resched_rt () barrier();#else # define preempt_enable_no_resched () preempt_enable() -# define preempt_check_resched_rt () barrier(); +# define preempt_check_resched_rt () preempt_check_resched()#endif #define preemptible () (preempt_count() == 0 && !irqs_disabled())
@@ -333,13 +341,9 @@ do { \#ifdef CONFIG_PREEMPT_RT # define preempt_disable_rt () preempt_disable()# define preempt_enable_rt () preempt_enable() -# define preempt_disable_nort () barrier() -# define preempt_enable_nort () barrier()#else # define preempt_disable_rt () barrier()# define preempt_enable_rt () barrier() -# define preempt_disable_nort () preempt_disable() -# define preempt_enable_nort () preempt_enable()#endif #ifdef CONFIG_PREEMPT_NOTIFIERS
include/linux/rcupdate.h +0 -7
@@ -54,11 +54,6 @@ void __rcu_read_unlock(void);* types of kernel builds, the rcu_read_lock() nesting depth is unknowable. */ #define rcu_preempt_depth () READ_ONCE(current->rcu_read_lock_nesting) -#ifndef CONFIG_PREEMPT_RT -#define sched_rcu_preempt_depth () rcu_preempt_depth() -#else -static inline int sched_rcu_preempt_depth (void ) {return 0 ; } -#endif #else /* #ifdef CONFIG_PREEMPT_RCU */
@@ -84,8 +79,6 @@ static inline int rcu_preempt_depth(void) return 0; } -#define sched_rcu_preempt_depth () rcu_preempt_depth() -#endif /* #else #ifdef CONFIG_PREEMPT_RCU */ /* Internal to kernel */
include/linux/sched.h +9 -9
@@ -2169,19 +2169,19 @@ extern int __cond_resched_lock(spinlock_t *lock);extern int __cond_resched_rwlock_read (rwlock_t *lock);extern int __cond_resched_rwlock_write (rwlock_t *lock); -#define cond_resched_lock (lock) ({ \ - ___might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET);\ - __cond_resched_lock(lock); \ +#define cond_resched_lock (lock) ({ \ + __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_RESCHED_OFFSET); \ + __cond_resched_lock(lock); \ }) -#define cond_resched_rwlock_read (lock) ({ \ - __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \ - __cond_resched_rwlock_read(lock); \ +#define cond_resched_rwlock_read (lock) ({ \ + __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_RESCHED_OFFSET); \ + __cond_resched_rwlock_read(lock); \ }) -#define cond_resched_rwlock_write (lock) ({ \ - __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \ - __cond_resched_rwlock_write(lock); \ +#define cond_resched_rwlock_write (lock) ( { \ + __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_RESCHED_OFFSET); \ + __cond_resched_rwlock_write(lock); \ })static inline void cond_resched_rcu (void )
init/Kconfig +0 -1
@@ -1009,7 +1009,6 @@ config CFS_BANDWIDTH config RT_GROUP_SCHED bool "Group scheduling for SCHED_RR/FIFO" depends on CGROUP_SCHED - depends on !PREEMPT_RT default n help This feature lets you explicitly allocate real CPU bandwidth
kernel/cgroup/cpuset.c +41 -41
279 lines not on this page · raw message
kernel/irq/spurious.c +8 -8
@@ -447,10 +447,10 @@ MODULE_PARM_DESC(noirqdebug, "Disable irq lockup detection when true");static int __init irqfixup_setup (char *str) { -#ifdef CONFIG_PREEMPT_RT -pr_warn ("irqfixup boot option not supported w/ CONFIG_PREEMPT_RT\n" ); -return 1 ; -#endif +if (IS_ENABLED (CONFIG_PREEMPT_RT )) { +pr_warn ("irqfixup boot option not supported with PREEMPT_RT\n" ); +return 1 ; + } irqfixup =1 ;printk (KERN_WARNING "Misrouted IRQ fixup support enabled.\n" );printk (KERN_WARNING "This may impact system performance.\n" );
@@ -463,10 +463,10 @@ module_param(irqfixup, int, 0644);static int __init irqpoll_setup (char *str) { -#ifdef CONFIG_PREEMPT_RT -pr_warn ("irqpoll boot option not supported w/ CONFIG_PREEMPT_RT\n" ); -return 1 ; -#endif +if (IS_ENABLED (CONFIG_PREEMPT_RT )) { +pr_warn ("irqpoll boot option not supported with PREEMPT_RT\n" ); +return 1 ; + } irqfixup =2 ;printk (KERN_WARNING "Misrouted IRQ fixup and polling support " "enabled\n" );
kernel/locking/spinlock_rt.c +11 -3
@@ -24,6 +24,14 @@#define RT_MUTEX_BUILD_SPINLOCKS #include "rtmutex.c" +/* +* Use ___might_sleep() which skips the state check and take RCU nesting +* into account as spin/read/write_lock() can legitimately nest into an RCU +* read side critical section: +*/ +#define rtlock_might_sleep () \ + ___might_sleep(__FILE__, __LINE__, rcu_preempt_depth()) + static __always_inline void rtlock_lock(struct rt_mutex_base *rtm) {if (unlikely (!rt_mutex_cmpxchg_acquire (rtm,NULL , current)))
@@ -32,7 +40,7 @@ static __always_inline void rtlock_lock(struct rt_mutex_base *rtm) static __always_inline void __rt_spin_lock(spinlock_t *lock) { -___might_sleep (__FILE__, __LINE__,0 ); +rtlock_might_sleep ();rtlock_lock (&lock->lock);rcu_read_lock ();migrate_disable ();
@@ -210,7 +218,7 @@ EXPORT_SYMBOL(rt_write_trylock); void __sched rt_read_lock(rwlock_t *rwlock) { -___might_sleep (__FILE__, __LINE__,0 ); +rtlock_might_sleep ();rwlock_acquire_read (&rwlock->dep_map,0 ,0 , _RET_IP_);rwbase_read_lock (&rwlock->rwbase,TASK_RTLOCK_WAIT );rcu_read_lock ();
@@ -220,7 +228,7 @@ EXPORT_SYMBOL(rt_read_lock); void __sched rt_write_lock(rwlock_t *rwlock) { -___might_sleep (__FILE__, __LINE__,0 ); +rtlock_might_sleep ();rwlock_acquire (&rwlock->dep_map,0 ,0 , _RET_IP_);rwbase_write_lock (&rwlock->rwbase,TASK_RTLOCK_WAIT );rcu_read_lock ();
kernel/rcu/tree.c +4 -7
@@ -80,7 +80,6 @@ static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, rcu_data) = { .dynticks = ATOMIC_INIT(1), #ifdef CONFIG_RCU_NOCB_CPU .cblist.flags = SEGCBLIST_SOFTIRQ_ONLY, - .nocb_local_lock = INIT_LOCAL_LOCK(nocb_local_lock),#endif };static struct rcu_state rcu_state = {
@@ -2279,13 +2278,13 @@ rcu_report_qs_rdp(struct rcu_data *rdp) {unsigned long flags;unsigned long mask; -bool needwake = false; -const bool offloaded =rcu_rdp_is_offloaded (rdp); +bool offloaded, needwake = false;struct rcu_node *rnp;WARN_ON_ONCE (rdp->cpu !=smp_processor_id ()); rnp = rdp->mynode;raw_spin_lock_irqsave_rcu_node (rnp, flags); + offloaded =rcu_rdp_is_offloaded (rdp);if (rdp->cpu_no_qs.b.norm || rdp->gp_seq != rnp->gp_seq || rdp->gpwrap) {
@@ -2447,7 +2446,7 @@ static void rcu_do_batch(struct rcu_data *rdp)int div;bool __maybe_unused empty;unsigned long flags; -const bool offloaded =rcu_rdp_is_offloaded (rdp); +bool offloaded;struct rcu_head *rhp;struct rcu_cblist rcl =RCU_CBLIST_INITIALIZER (rcl);long bl, count =0 ;
@@ -2473,6 +2472,7 @@ static void rcu_do_batch(struct rcu_data *rdp)rcu_nocb_lock (rdp);WARN_ON_ONCE (cpu_is_offline (smp_processor_id ())); pending =rcu_segcblist_n_cbs (&rdp->cblist); + offloaded =rcu_rdp_is_offloaded (rdp); div =READ_ONCE (rcu_divisor); div = div <0 ?7 : div >sizeof (long ) *8 -2 ?sizeof (long ) *8 -2 : div; bl =max (rdp->blimit, pending >> div);
@@ -2812,12 +2812,10 @@ static void rcu_cpu_kthread(unsigned int cpu) {unsigned int *statusp =this_cpu_ptr (&rcu_data.rcu_cpu_kthread_status);char work, *workp =this_cpu_ptr (&rcu_data.rcu_cpu_has_work); -struct rcu_data *rdp =this_cpu_ptr (&rcu_data);int spincnt;trace_rcu_utilization (TPS ("Start CPU kthread@rcu_run" ));for (spincnt =0 ; spincnt <10 ; spincnt++) { -rcu_nocb_local_lock (rdp);local_bh_disable (); *statusp =RCU_KTHREAD_RUNNING ;local_irq_disable ();
@@ -2827,7 +2825,6 @@ static void rcu_cpu_kthread(unsigned int cpu)if (work)rcu_core ();local_bh_enable (); -rcu_nocb_local_unlock (rdp);if (*workp ==0 ) {trace_rcu_utilization (TPS ("End CPU kthread@rcu_wait" )); *statusp =RCU_KTHREAD_WAITING ;
kernel/rcu/tree.h +0 -4
@@ -210,8 +210,6 @@ struct rcu_data {struct timer_list nocb_timer;/* Enforce finite deferral. */ unsigned long nocb_gp_adv_time;/* Last call_rcu() CB adv (jiffies). */ -local_lock_t nocb_local_lock; -/* The following fields are used by call_rcu, hence own cacheline. */ raw_spinlock_t nocb_bypass_lock____cacheline_internodealigned_in_smp ;struct rcu_cblist nocb_bypass;/* Lock-contention-bypass CB list. */
@@ -447,8 +445,6 @@ static void rcu_nocb_unlock(struct rcu_data *rdp);static void rcu_nocb_unlock_irqrestore (struct rcu_data *rdp,unsigned long flags);static void rcu_lockdep_assert_cblist_protected (struct rcu_data *rdp); -static void rcu_nocb_local_lock (struct rcu_data *rdp); -static void rcu_nocb_local_unlock (struct rcu_data *rdp);#ifdef CONFIG_RCU_NOCB_CPU static void __init rcu_organize_nocb_kthreads (void );#define rcu_nocb_lock_irqsave (rdp, flags) \
kernel/rcu/tree_nocb.h +0 -39
@@ -21,11 +21,6 @@ static inline int rcu_lockdep_is_held_nocb(struct rcu_data *rdp)return lockdep_is_held (&rdp->nocb_lock); } -static inline int rcu_lockdep_is_held_nocb_local (struct rcu_data *rdp) -{ -return lockdep_is_held (&rdp->nocb_local_lock); -} -static inline bool rcu_current_is_nocb_kthread (struct rcu_data *rdp) {/* Race on early boot between thread creation and assignment */
@@ -186,22 +181,6 @@ static void rcu_nocb_unlock_irqrestore(struct rcu_data *rdp, } } -/* -* The invocation of rcu_core() within the RCU core kthreads remains preemptible -* under PREEMPT_RT, thus the offload state of a CPU could change while -* said kthreads are preempted. Prevent this from happening by protecting the -* offload state with a local_lock(). -*/ -static void rcu_nocb_local_lock (struct rcu_data *rdp) -{ -local_lock (&rcu_data.nocb_local_lock); -} - -static void rcu_nocb_local_unlock (struct rcu_data *rdp) -{ -local_unlock (&rcu_data.nocb_local_lock); -} -/* Lockdep check that ->cblist may be safely accessed. */ static void rcu_lockdep_assert_cblist_protected (struct rcu_data *rdp) {
@@ -969,7 +948,6 @@ static int rdp_offload_toggle(struct rcu_data *rdp,if (rdp->nocb_cb_sleep) rdp->nocb_cb_sleep = false;rcu_nocb_unlock_irqrestore (rdp, flags); -rcu_nocb_local_unlock (rdp);/* * Ignore former value of nocb_cb_sleep and force wake up as it could
@@ -1001,7 +979,6 @@ static long rcu_nocb_rdp_deoffload(void *arg)pr_info ("De-offloading %d\n" , rdp->cpu); -rcu_nocb_local_lock (rdp);rcu_nocb_lock_irqsave (rdp, flags);/* * Flush once and for all now. This suffices because we are
@@ -1084,7 +1061,6 @@ static long rcu_nocb_rdp_offload(void *arg)* Can't use rcu_nocb_lock_irqsave() while we are in * SEGCBLIST_SOFTIRQ_ONLY mode. */ -rcu_nocb_local_lock (rdp);raw_spin_lock_irqsave (&rdp->nocb_lock, flags);/*
@@ -1432,11 +1408,6 @@ static inline int rcu_lockdep_is_held_nocb(struct rcu_data *rdp)return 0 ; } -static inline int rcu_lockdep_is_held_nocb_local (struct rcu_data *rdp) -{ -return 0 ; -} -static inline bool rcu_current_is_nocb_kthread (struct rcu_data *rdp) {return false;
@@ -1459,16 +1430,6 @@ static void rcu_nocb_unlock_irqrestore(struct rcu_data *rdp,local_irq_restore (flags); } -/* No ->nocb_local_lock to acquire. */ -static void rcu_nocb_local_lock (struct rcu_data *rdp) -{ -} - -/* No ->nocb_local_lock to release. */ -static void rcu_nocb_local_unlock (struct rcu_data *rdp) -{ -} -/* Lockdep check that ->cblist may be safely accessed. */ static void rcu_lockdep_assert_cblist_protected (struct rcu_data *rdp) {
kernel/rcu/tree_plugin.h +8 -30
@@ -13,45 +13,23 @@#include "../locking/rtmutex_common.h" -/* -* Is a local read of the rdp's offloaded state safe and stable? -* See rcu_nocb_local_lock() & family. -*/ -static inline bool rcu_local_offload_access_safe (struct rcu_data *rdp) -{ -if (!preemptible ()) -return true; - -if (!is_migratable ()) { -if (!IS_ENABLED (CONFIG_RCU_NOCB )) -return true; - -return rcu_lockdep_is_held_nocb_local (rdp); - } - -return false; -} -static bool rcu_rdp_is_offloaded (struct rcu_data *rdp) {/* -* In order to read the offloaded state of an rdp is a safe and stable -* way and prevent from its value to be changed under us, we must -* either... +* In order to read the offloaded state of an rdp is a safe +* and stable way and prevent from its value to be changed +* under us, we must either hold the barrier mutex, the cpu +* hotplug lock (read or write) or the nocb lock. Local +* non-preemptible reads are also safe. NOCB kthreads and +* timers have their own means of synchronization against the +* offloaded state updaters. */ RCU_LOCKDEP_WARN ( -// ...hold the barrier mutex... !(lockdep_is_held (&rcu_state.barrier_mutex) || -// ... the cpu hotplug lock (read or write)... (IS_ENABLED (CONFIG_HOTPLUG_CPU ) &&lockdep_is_cpus_held ()) || -// ... or the NOCB lock. rcu_lockdep_is_held_nocb (rdp) || -// Local reads still require the local state to remain stable -// (preemption disabled / local lock held) (rdp ==this_cpu_ptr (&rcu_data) && -rcu_local_offload_access_safe (rdp)) || -// NOCB kthreads and timers have their own means of -// synchronization against the offloaded state updaters. + !(IS_ENABLED (CONFIG_PREEMPT_COUNT ) &&preemptible ())) ||rcu_current_is_nocb_kthread (rdp)),"Unsafe read of RCU_NOCB offloaded state" );
kernel/sched/core.c +1 -1
@@ -9547,7 +9547,7 @@ void __init sched_init(void)#ifdef CONFIG_DEBUG_ATOMIC_SLEEP static inline int preempt_count_equals (int preempt_offset) { -int nested =preempt_count () +sched_rcu_preempt_depth (); +int nested =preempt_count () +rcu_preempt_depth ();return (nested == preempt_offset); }
localversion-rt +1 -1
@@ -1 +1 @@ --rt2 +-rt3
v5.15-rc2-rt3: WARNING: CPU: 0 PID: 12 at ./include/linux/seqlock.h:271
Greetings,
I met this lockdep_assert_preemption_disabled() gripe when starting ltp zram tests.
[ 69.508019] WARNING: CPU: 0 PID: 12 at ./include/linux/seqlock.h:271 br_multicast_update_querier.isra.61+0xd9/0xf0 [bridge] [ 69.508037] Modules linked in: af_packet(E) ip6table_mangle(E) ip6table_raw(E) iptable_raw(E) bridge(E) stp(E) llc(E) iscsi_ibft(E) iscsi_boot_sysfs(E) nfnetlink(E) ebtable_filter(E) rfkill(E) ebtables(E) ip6table_filter(E) ip6_tables(E) iptable_filter(E) ip_tables(E) x_tables(E) bpfilter(E) usblp(E) joydev(E) intel_rapl_msr(E) intel_rapl_common(E) nls_iso8859_1(E) nls_cp437(E) x86_pkg_temp_thermal(E) intel_powerclamp(E) coretemp(E) kvm_intel(E) snd_hda_codec_realtek(E) snd_hda_codec_generic(E) snd_hda_codec_hdmi(E) ledtrig_audio(E) at24(E) regmap_i2c(E) iTCO_wdt(E) snd_hda_intel(E) snd_intel_dspcfg(E) mei_hdcp(E) kvm(E) intel_pmc_bxt(E) iTCO_vendor_support(E) snd_hda_codec(E) snd_hwdep(E) irqbypass(E) crct10dif_pclmul(E) crc32_pclmul(E) snd_hda_core(E) ghash_clmulni_intel(E) aesni_intel(E) r8169(E) crypto_simd(E) realtek(E) cryptd(E) i2c_i801(E) mdio_devres(E) snd_pcm(E) snd_timer(E) pcspkr(E) i2c_smbus(E) mei_me(E) libphy(E) snd(E) lpc_ich(E) mei(E) soundcore(E) mfd_core(E) fan(E) [ 69.508069] thermal(E) intel_smartconnect(E) sch_fq_codel(E) nfsd(E) auth_rpcgss(E) nfs_acl(E) lockd(E) grace(E) fuse(E) sunrpc(E) configfs(E) hid_logitech_hidpp(E) hid_logitech_dj(E) uas(E) usb_storage(E) hid_generic(E) usbhid(E) nouveau(E) wmi(E) drm_ttm_helper(E) ttm(E) i2c_algo_bit(E) drm_kms_helper(E) syscopyarea(E) sysfillrect(E) sysimgblt(E) fb_sys_fops(E) ahci(E) cec(E) libahci(E) rc_core(E) xhci_pci(E) ehci_pci(E) drm(E) libata(E) ehci_hcd(E) xhci_hcd(E) usbcore(E) video(E) button(E) sd_mod(E) t10_pi(E) vfat(E) fat(E) virtio_blk(E) virtio_mmio(E) virtio_ring(E) virtio(E) ext4(E) crc32c_intel(E) crc16(E) mbcache(E) jbd2(E) sg(E) dm_multipath(E) dm_mod(E) scsi_dh_rdac(E) scsi_dh_emc(E) scsi_dh_alua(E) scsi_mod(E) msr(E) autofs4(E) [ 69.508098] CPU: 0 PID: 12 Comm: ksoftirqd/0 Kdump: loaded Tainted: G E 5.15.0.g3839cbc-rt3-master-rt-lockdep #12 [ 69.508100] Hardware name: MEDION MS-7848/MS-7848, BIOS M7848W08.20C 09/23/2013 [ 69.508101] RIP: 0010:br_multicast_update_querier.isra.61+0xd9/0xf0 [bridge] [ 69.508109] Code: 5f 85 c0 0f 85 66 ff ff ff 65 8b 05 11 5a 1b 5f a9 ff ff ff 7f 0f 85 54 ff ff ff 65 8b 05 d3 61 1b 5f 85 c0 0f 84 45 ff ff ff <0f> 0b e9 3e ff ff ff 0f 0b eb b7 66 66 2e 0f 1f 84 00 00 00 00 00 [ 69.508111] RSP: 0018:ffff8881008ab9c0 EFLAGS: 00010202 [ 69.508112] RAX: 0000000000000001 RBX: ffff8881076f12a0 RCX: 0000000000000001 [ 69.508113] RDX: 0000000000000001 RSI: ffffffff8204d9a5 RDI: ffffffff8209ee5e [ 69.508114] RBP: ffff8881008aba70 R08: 0000000000000000 R09: 0000000000000000 [ 69.508115] R10: ffff8881c56aa266 R11: 0000000000000005 R12: 0000000000000002 [ 69.508115] R13: 0000000000000002 R14: 0000000000000008 R15: ffff8881076f1148 [ 69.508116] FS: 0000000000000000(0000) GS:ffff88840ec00000(0000) knlGS:0000000000000000 [ 69.508117] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 69.508118] CR2: 000055809b1fe000 CR3: 0000000004a3e002 CR4: 00000000001706f0 [ 69.508119] Call Trace: [ 69.508125] br_multicast_select_querier+0x85/0xd0 [bridge] [ 69.508135] br_multicast_rcv+0x933/0x1c30 [bridge] [ 69.508159] ? br_fdb_update+0x61/0x480 [bridge] [ 69.508171] ? br_handle_frame_finish+0x1a8/0x510 [bridge] [ 69.508178] br_handle_frame_finish+0x1a8/0x510 [bridge] [ 69.508191] br_handle_frame+0x23a/0x500 [bridge] [ 69.508199] ? lock_is_held_type+0xdf/0x130 [ 69.508203] ? br_handle_frame_finish+0x510/0x510 [bridge] [ 69.508210] ? br_handle_frame_finish+0x510/0x510 [bridge] [ 69.508219] __netif_receive_skb_core+0x23f/0x1200 [ 69.508221] ? __lock_acquire+0x49b/0x1ab0 [ 69.508237] ? __netif_receive_skb_list_core+0xf8/0x260 [ 69.508238] __netif_receive_skb_list_core+0xf8/0x260 [ 69.508249] netif_receive_skb_list_internal+0x19b/0x340 [ 69.508257] napi_complete_done+0x100/0x1a0 [ 69.508262] rtl8169_poll+0x48f/0x550 [r8169] [ 69.508272] __napi_poll+0x2a/0x290 [ 69.508276] net_rx_action+0x228/0x280 [ 69.508286] __do_softirq+0xb5/0x516 [ 69.508292] ? smpboot_thread_fn+0x23/0x340 [ 69.508297] run_ksoftirqd+0x79/0xd0 [ 69.508299] smpboot_thread_fn+0x25d/0x340 [ 69.508303] ? smpboot_register_percpu_thread+0xe0/0xe0 [ 69.508306] kthread+0x193/0x1c0 [ 69.508310] ? set_kthread_struct+0x40/0x40 [ 69.508315] ret_from_fork+0x1f/0x30 [ 69.508332] irq event stamp: 169818 [ 69.508332] hardirqs last enabled at (169820): [<ffffffff810f35ea>] vprintk_store+0x33a/0x590 [ 69.508334] hardirqs last disabled at (169821): [<ffffffff810f3634>] vprintk_store+0x384/0x590 [ 69.508335] softirqs last enabled at (169444): [<ffffffff8107fd28>] run_ksoftirqd+0x88/0xd0 [ 69.508337] softirqs last disabled at (169450): [<ffffffff810aaaad>] smpboot_thread_fn+0x25d/0x340
[patch] Re: v5.15-rc2-rt3: WARNING: CPU: 0 PID: 12 at ./include/linux/seqlock.h:271
Quoted 4 lines · Mike Galbraith
Greetings,
I met this
lockdep_assert_preemption_disabled()gripe when starting ltp zram tests.
Before actually, I just wasn't paying attention.
<snip gripe>
net: bridge: mcast: Disable preemption in br_multicast_update_querier() for RT
write_seqcount_begin() in br_multicast_update_querier() complains about preemption not being disabled during RT softirq processesing. Since the read side spins, disable preemption across the tiny write side for RT.
--- net/bridge/br_multicast.c | 4 ++++ 1 file changed, 4 insertions(+)
net/bridge/br_multicast.c +4 -0
@@ -1679,10 +1679,14 @@ static void br_multicast_update_querier( {lockdep_assert_held_once (&brmctx->br->multicast_lock); +if (IS_ENABLED (CONFIG_PREEMPT_RT )) +preempt_disable ();write_seqcount_begin (&querier->seq); querier->port_ifidx = ifindex;memcpy (&querier->addr, saddr,sizeof (*saddr));write_seqcount_end (&querier->seq); +if (IS_ENABLED (CONFIG_PREEMPT_RT )) +preempt_enable (); } static void br_multicast_send_query(struct net_bridge_mcast *brmctx,
Re: [patch] Re: v5.15-rc2-rt3: WARNING: CPU: 0 PID: 12 at ./include/linux/seqlock.h:271
net/bridge/br_multicast.c static void br_multicast_update_querier( · line 1683
Quoted 9 lines · Mike Galbraith
On Fri, 2021-09-24 at 07:22 +0200, Mike Galbraith wrote:
net/bridge/br_multicast.c +2
-0@@ -1679,10 +1679,14 @@ static void br_multicast_update_querier( {lockdep_assert_held_once (&brmctx->br->multicast_lock); +if (IS_ENABLED (CONFIG_PREEMPT_RT )) +preempt_disable ();
That sequence count is protected by brmctx->br->multicast_lock, but seqcount_init() does not associate the lock.
Untested below should cure it properly.
Thanks,
tglx
---
net/bridge/br_multicast.c +2 -4
@@ -1677,8 +1677,6 @@ static void br_multicast_update_querier(int ifindex, struct br_ip *saddr) { - lockdep_assert_held_once(&brmctx->br->multicast_lock); - write_seqcount_begin(&querier->seq); querier->port_ifidx = ifindex;memcpy (&querier->addr, saddr,sizeof (*saddr));
@@ -3867,13 +3865,13 @@ void br_multicast_ctx_init(struct net_br brmctx->ip4_other_query.delay_time =0 ; brmctx->ip4_querier.port_ifidx =0 ; -seqcount_init (&brmctx->ip4_querier.seq); +seqcount_spinlock_init (&brmctx->ip4_querier.seq, &br->multicast_lock); brmctx->multicast_igmp_version =2 ;#if IS_ENABLED (CONFIG_IPV6 ) brmctx->multicast_mld_version =1 ; brmctx->ip6_other_query.delay_time =0 ; brmctx->ip6_querier.port_ifidx =0 ; -seqcount_init (&brmctx->ip6_querier.seq); +seqcount_spinlock_init (&brmctx->ip6_querier.seq, &br->multicast_lock);#endif timer_setup(&brmctx->ip4_mc_router_timer,
net/bridge/br_private.h +1 -1
@@ -82,7 +82,7 @@ struct bridge_mcast_other_query {struct bridge_mcast_querier {struct br_ip addr;int port_ifidx; -seqcount_t seq; +seqcount_spinlock_t seq; };/* IGMP/MLD statistics */
Re: [patch] Re: v5.15-rc2-rt3: WARNING: CPU: 0 PID: 12 at ./include/linux/seqlock.h:271
Quoted 5 lines · Thomas Gleixner
That sequence count is protected by
brmctx->br->multicast_lock, butseqcount_init()does not associate the lock.Untested below should cure it properly.
Yup, it did.
Hrmph, there were even free samples in older trees.. that live right in front of me. Bugger... oh well, bring it on trivial seqcount bugs, ya barely scratched me! <shakes fist> :)
-Mike
PATCH 1/1 net: bridge: mcast: Associate the seqcount with its protecting lock.
From: Thomas Gleixner <[email protected]>
Date: Sun, 26 Sep 2021 17:10:45 +0200
The sequence count bridge_mcast_querier::seq is protected by net_bridge::multicast_lock but seqcount_init() does not associate the seqcount with the lock. This leads to a warning on PREEMPT_RT because preemption is still enabled.
Let seqcount_init() associate the seqcount with lock that protects the write section. Remove lockdep_assert_held_once() because lockdep checks for the associated lock.
---
I would post this official unless there are objections.
net/bridge/br_multicast.c | 6 ++---- net/bridge/br_private.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
net/bridge/br_multicast.c +2 -4
@@ -1677,8 +1677,6 @@ static void br_multicast_update_querier(struct net_bridge_mcast *brmctx,int ifindex, struct br_ip *saddr) { - lockdep_assert_held_once(&brmctx->br->multicast_lock); - write_seqcount_begin(&querier->seq); querier->port_ifidx = ifindex;memcpy (&querier->addr, saddr,sizeof (*saddr));
@@ -3867,13 +3865,13 @@ void br_multicast_ctx_init(struct net_bridge *br, brmctx->ip4_other_query.delay_time =0 ; brmctx->ip4_querier.port_ifidx =0 ; -seqcount_init (&brmctx->ip4_querier.seq); +seqcount_spinlock_init (&brmctx->ip4_querier.seq, &br->multicast_lock); brmctx->multicast_igmp_version =2 ;#if IS_ENABLED (CONFIG_IPV6 ) brmctx->multicast_mld_version =1 ; brmctx->ip6_other_query.delay_time =0 ; brmctx->ip6_querier.port_ifidx =0 ; -seqcount_init (&brmctx->ip6_querier.seq); +seqcount_spinlock_init (&brmctx->ip6_querier.seq, &br->multicast_lock);#endif timer_setup(&brmctx->ip4_mc_router_timer,
net/bridge/br_private.h +1 -1
@@ -82,7 +82,7 @@ struct bridge_mcast_other_query {struct bridge_mcast_querier {struct br_ip addr;int port_ifidx; -seqcount_t seq; +seqcount_spinlock_t seq; };/* IGMP/MLD statistics */
Signature · 1 line
2.33.0