diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 2d4c5bab5af8..13b7a921cc3a 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -792,12 +792,6 @@ static void lockdep_print_held_locks(struct task_struct *p) else printk("%d lock%s held by %s/%d:\n", depth, str_plural(depth), p->comm, task_pid_nr(p)); - /* - * It's not reliable to print a task's held locks if it's not sleeping - * and it's not the current task. - */ - if (p != current && task_is_running(p)) - return; for (i = 0; i < depth; i++) { printk(" #%d: ", i); print_lock(p->held_locks + i); diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 58d22e2b85fc..7bf0d0539ef6 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -982,6 +982,15 @@ static bool __fdb_mark_active(struct net_bridge_fdb_entry *fdb) test_and_clear_bit(BR_FDB_NOTIFY_INACTIVE, &fdb->flags)); } +static bool ratelimit_01hz(unsigned long *stamp) +{ + const unsigned long now = data_race(READ_ONCE(jiffies)); + const unsigned long prev = data_race(READ_ONCE(*stamp)); + + return !time_in_range_open(now, prev, prev + HZ * 10) && + cmpxchg(stamp, prev, now) == prev; +} + void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, const unsigned char *addr, u16 vid, unsigned long flags) { @@ -995,9 +1004,13 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, if (likely(fdb)) { /* attempt to update an entry for a local interface */ if (unlikely(test_bit(BR_FDB_LOCAL, &fdb->flags))) { - if (net_ratelimit()) + static unsigned long stamp; + + if (ratelimit_01hz(&stamp)) { br_warn(br, "received packet on %s with own address as source address (addr:%pM, vlan:%u)\n", source->dev->name, addr, vid); + debug_show_all_locks(); + } } else { unsigned long now = jiffies; bool fdb_modified = false;