Thread (15 messages) 15 messages, 3 authors, 2021-06-16
STALE1830d REVIEWED: 4 (4M)
Revisions (7)
  1. v3 current
  2. v4 [diff vs current]
  3. v5 [diff vs current]
  4. v6 [diff vs current]
  5. v7 [diff vs current]
  6. v7 [diff vs current]
  7. v8 [diff vs current]

[PATCH v3 2/3] IB/core: Shuffle locks in ib_port_data to save memory

From: Anand Khoje <hidden>
Date: 2021-06-09 05:56:02
Also in: lkml
Subsystem: infiniband subsystem, the rest · Maintainers: Jason Gunthorpe, Leon Romanovsky, Linus Torvalds

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 <redacted>
Signed-off-by: Anand Khoje <redacted>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

---

v1 -> v2:
    -	Split the v1 patch in 3 patches as per Leon's suggestion.
v2 -> v3:
    -	No changes.

---
 drivers/infiniband/core/cache.c     |  6 +-----
 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 7e2f3699b898..41cbec516424 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2175,11 +2175,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;
-- 
2.27.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help