Skip to content

Commit

Permalink
bonding: remove useless stats_lock_key
Browse files Browse the repository at this point in the history
After commit b3e80d4
("bonding: fix lockdep warning in bond_get_stats()") the dynamic
key is no longer necessary, as we compute nest level at run-time.
So, we can just remove it to save some lockdep key entries.

Test commands:
 ip link add bond0 type bond
 ip link add bond1 type bond
 ip link set bond0 master bond1
 ip link set bond0 nomaster
 ip link set bond1 master bond0

Reported-and-tested-by: [email protected]
Cc: Dmitry Vyukov <[email protected]>
Acked-by: Taehee Yoo <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
congwang authored and davem330 committed May 4, 2020
1 parent 1a33e10 commit e7511f5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4491,7 +4491,6 @@ static void bond_uninit(struct net_device *bond_dev)

list_del(&bond->bond_list);

lockdep_unregister_key(&bond->stats_lock_key);
bond_debug_unregister(bond);
}

Expand Down Expand Up @@ -4896,8 +4895,6 @@ static int bond_init(struct net_device *bond_dev)
return -ENOMEM;

spin_lock_init(&bond->stats_lock);
lockdep_register_key(&bond->stats_lock_key);
lockdep_set_class(&bond->stats_lock, &bond->stats_lock_key);
netdev_lockdep_set_classes(bond_dev);

list_add_tail(&bond->bond_list, &bn->dev_list);
Expand Down
1 change: 0 additions & 1 deletion include/net/bonding.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ struct bonding {
struct dentry *debug_dir;
#endif /* CONFIG_DEBUG_FS */
struct rtnl_link_stats64 bond_stats;
struct lock_class_key stats_lock_key;
};

#define bond_slave_get_rcu(dev) \
Expand Down

0 comments on commit e7511f5

Please sign in to comment.