Commit 84dcd8c7 authored by Anand Khoje's avatar Anand Khoje Committed by Jason Gunthorpe
Browse files

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: default avatarHaakon Bugge <haakon.bugge@oracle.com>
Signed-off-by: default avatarAnand Khoje <anand.a.khoje@oracle.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent c5f8f2c5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;