IB/core: Shuffle locks in ib_port_data to save memory

pahole shows two 4-byte holes in struct ib_port_data after pkey_list_lock
and netdev_lock respectively.

Shuffling the netdev_lock to be after pkey_list_lock, this shaves off
eight bytes from the struct.

Link: https://lore.kernel.org/r/20210616154509.1047-3-anand.a.khoje@oracle.com
Suggested-by: Haakon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Anand Khoje <anand.a.khoje@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
Anand Khoje 2021-06-16 21:15:08 +05:30 committed by Jason Gunthorpe
parent c5f8f2c5e5
commit 84dcd8c7ea
1 changed files with 3 additions and 1 deletions

View File

@ -2176,11 +2176,13 @@ struct ib_port_data {
struct ib_port_immutable immutable;
spinlock_t pkey_list_lock;
spinlock_t netdev_lock;
struct list_head pkey_list;
struct ib_port_cache cache;
spinlock_t netdev_lock;
struct net_device __rcu *netdev;
struct hlist_node ndev_hash_link;
struct rdma_port_counter port_counter;