Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/rdmavt: Correct issues with read-mostly and send size cache lines

The s_ahgpsn was incorrectly placed in the read-mostly section of the QP
and the s_curr_size and s_hdrwords are oversized. The misplaced
s_ahgpsn will cause the read-mostly cachelines to thrash.

Place s_ahgpsn in the send side cache lines and correctly size and
s_hdrwords and s_cur_size to keep the send side cachelines at the same
size.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Sebastian Sanchez and committed by
Doug Ledford
7ebfc93e a917374e

+5 -5
+2 -2
drivers/infiniband/hw/hfi1/chip.c
··· 8739 8739 return do_8051_command(dd, HCMD_CHANGE_PHY_STATE, state, NULL); 8740 8740 } 8741 8741 8742 - int _load_8051_config(struct hfi1_devdata *dd, u8 field_id, 8743 - u8 lane_id, u32 config_data) 8742 + static int _load_8051_config(struct hfi1_devdata *dd, u8 field_id, 8743 + u8 lane_id, u32 config_data) 8744 8744 { 8745 8745 u64 data; 8746 8746 int ret;
+3 -3
include/rdma/rdmavt_qp.h
··· 282 282 u32 remote_qpn; 283 283 u32 qkey; /* QKEY for this QP (for UD or RD) */ 284 284 u32 s_size; /* send work queue size */ 285 - u32 s_ahgpsn; /* set to the psn in the copy of the header */ 286 285 287 286 u16 pmtu; /* decoded from path_mtu */ 288 287 u8 log_pmtu; /* shift for pmtu */ ··· 343 344 struct rvt_swqe *s_wqe; 344 345 struct rvt_sge_state s_sge; /* current send request data */ 345 346 struct rvt_mregion *s_rdma_mr; 346 - u32 s_cur_size; /* size of send packet in bytes */ 347 347 u32 s_len; /* total length of s_sge */ 348 348 u32 s_rdma_read_len; /* total length of s_rdma_read_sge */ 349 349 u32 s_last_psn; /* last response PSN processed */ ··· 356 358 u32 s_acked; /* last un-ACK'ed entry */ 357 359 u32 s_last; /* last completed entry */ 358 360 u32 s_lsn; /* limit sequence number (credit) */ 359 - u16 s_hdrwords; /* size of s_hdr in 32 bit words */ 361 + u32 s_ahgpsn; /* set to the psn in the copy of the header */ 362 + u16 s_cur_size; /* size of send packet in bytes */ 360 363 u16 s_rdma_ack_cnt; 364 + u8 s_hdrwords; /* size of s_hdr in 32 bit words */ 361 365 s8 s_ahgidx; 362 366 u8 s_state; /* opcode of last packet sent */ 363 367 u8 s_ack_state; /* opcode of packet to ACK */