--- x/drivers/net/wireless/mac80211_hwsim.c 2022-07-31 16:20:11.823504700 +0800 +++ y/drivers/net/wireless/mac80211_hwsim.c 2022-07-31 16:22:14.130567900 +0800 @@ -1788,8 +1788,9 @@ mac80211_hwsim_beacon(struct hrtimer *ti bcn_int -= data->bcn_delta; data->bcn_delta = 0; } - hrtimer_forward(&data->beacon_timer, hrtimer_get_expires(timer), - ns_to_ktime(bcn_int * NSEC_PER_USEC)); + + hrtimer_forward_now(&data->beacon_timer, ns_to_ktime(bcn_int * NSEC_PER_USEC)); + return HRTIMER_RESTART; } --- x/kernel/softirq.c 2022-07-31 18:37:44.062662300 +0800 +++ y/kernel/softirq.c 2022-07-31 18:52:39.657258700 +0800 @@ -300,12 +300,14 @@ static inline void lockdep_softirq_end(b asmlinkage __visible void __softirq_entry __do_softirq(void) { unsigned long end = jiffies + MAX_SOFTIRQ_TIME; + unsigned long ts_sum; unsigned long old_flags = current->flags; int max_restart = MAX_SOFTIRQ_RESTART; struct softirq_action *h; bool in_hardirq; __u32 pending; int softirq_bit; + int cpu = smp_processor_id(); /* * Mask out PF_MEMALLOC as the current task context is borrowed for the @@ -327,8 +329,10 @@ restart: local_irq_enable(); h = softirq_vec; + ts_sum = jiffies + 20; while ((softirq_bit = ffs(pending))) { + unsigned long ts; unsigned int vec_nr; int prev_count; @@ -338,10 +342,19 @@ restart: prev_count = preempt_count(); kstat_incr_softirqs_this_cpu(vec_nr); + ts = jiffies + 10; trace_softirq_entry(vec_nr); h->action(h); trace_softirq_exit(vec_nr); + + WARN_ONCE(time_after(jiffies, ts_sum), + "On CPU%d softirq took more than 20 ticks\n", cpu); + + WARN_ONCE(time_after(jiffies, ts), + "On CPU%d softirq %s took more than 10 ticks\n", + cpu, softirq_to_name[vec_nr]); + if (unlikely(prev_count != preempt_count())) { pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n", vec_nr, softirq_to_name[vec_nr], h->action, --- x/kernel/time/hrtimer.c 2022-07-31 15:07:43.454730700 +0800 +++ y/kernel/time/hrtimer.c 2022-07-31 18:55:23.426035000 +0800 @@ -1480,6 +1480,7 @@ static void __run_hrtimer(struct hrtimer { enum hrtimer_restart (*fn)(struct hrtimer *); bool expires_in_hardirq; + unsigned long ts; int restart; lockdep_assert_held(&cpu_base->lock); @@ -1515,9 +1516,16 @@ static void __run_hrtimer(struct hrtimer raw_spin_unlock_irqrestore(&cpu_base->lock, flags); trace_hrtimer_expire_entry(timer, now); expires_in_hardirq = lockdep_hrtimer_enter(timer); + ts = jiffies + 10; restart = fn(timer); + WARN_ONCE(time_after(jiffies, ts), + "On CPU%u hrtimer %ps took more than 10 ticks\n", cpu_base->cpu, fn); + /* + if (time_after(jiffies, ts)) + pr_warn("On CPU%u hrtimer %ps took more than 4 ticks\n", cpu_base->cpu, fn); +*/ lockdep_hrtimer_exit(expires_in_hardirq); trace_hrtimer_expire_exit(timer); raw_spin_lock_irq(&cpu_base->lock); --- x/net/wireless/ibss.c 2022-07-31 17:31:48.574469700 +0800 +++ y/net/wireless/ibss.c 2022-07-31 17:33:54.724578800 +0800 @@ -33,7 +33,7 @@ void __cfg80211_ibss_joined(struct net_d bss = cfg80211_get_bss(wdev->wiphy, channel, bssid, NULL, 0, IEEE80211_BSS_TYPE_IBSS, IEEE80211_PRIVACY_ANY); - if (WARN_ON(!bss)) + if (!bss) return; if (wdev->current_bss) {