[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210616065213.987-3-anand.a.khoje@oracle.com>
Date: Wed, 16 Jun 2021 12:22:12 +0530
From: Anand Khoje <anand.a.khoje@...cle.com>
To: linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: dledford@...hat.com, jgg@...pe.ca, haakon.bugge@...cle.com,
leon@...nel.org
Subject: [PATCH v4 for-next 2/3] 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.
Suggested-by: Haakon Bugge <haakon.bugge@...cle.com>
Signed-off-by: Anand Khoje <anand.a.khoje@...cle.com>
Reviewed-by: Leon Romanovsky <leonro@...dia.com>
---
v1 -> v2:
- Split the v1 patch in 3 patches as per Leon's suggestion.
v2 -> v3:
- No changes.
v3 -> v4:
- No changes.
---
include/rdma/ib_verbs.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 05dbc21..c96d601 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2174,11 +2174,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;
--
1.8.3.1
Powered by blists - more mailing lists