Skip to content

Commit 833fefa

Browse files
dhowellskuba-moo
authored andcommitted
rxrpc: peer->mtu_lock is redundant
The peer->mtu_lock is only used to lock around writes to peer->max_data - and nothing else; further, all such writes take place in the I/O thread and the lock is only ever write-locked and never read-locked. In a couple of places, the write_seqcount_begin() is wrapped in preempt_disable/enable(), but not in all places. This can cause lockdep to complain: WARNING: CPU: 0 PID: 1549 at include/linux/seqlock.h:221 rxrpc_input_ack_trailer+0x305/0x430 ... RIP: 0010:rxrpc_input_ack_trailer+0x305/0x430 Fix this by just getting rid of the lock. Fixes: eeaedc5 ("rxrpc: Implement path-MTU probing using padded PING ACKs (RFC8899)") Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: Simon Horman <[email protected]> cc: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c34d999 commit 833fefa

File tree

4 files changed

+1
-12
lines changed

4 files changed

+1
-12
lines changed

net/rxrpc/ar-internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ struct rxrpc_peer {
360360
u8 pmtud_jumbo; /* Max jumbo packets for the MTU */
361361
bool ackr_adv_pmtud; /* T if the peer advertises path-MTU */
362362
unsigned int ackr_max_data; /* Maximum data advertised by peer */
363-
seqcount_t mtu_lock; /* Lockless MTU access management */
364363
unsigned int if_mtu; /* Local interface MTU (- hdrsize) for this peer */
365364
unsigned int max_data; /* Maximum packet data capacity for this peer */
366365
unsigned short hdrsize; /* header size (IP + UDP + RxRPC) */

net/rxrpc/input.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,9 +810,7 @@ static void rxrpc_input_ack_trailer(struct rxrpc_call *call, struct sk_buff *skb
810810
if (max_mtu < peer->max_data) {
811811
trace_rxrpc_pmtud_reduce(peer, sp->hdr.serial, max_mtu,
812812
rxrpc_pmtud_reduce_ack);
813-
write_seqcount_begin(&peer->mtu_lock);
814813
peer->max_data = max_mtu;
815-
write_seqcount_end(&peer->mtu_lock);
816814
}
817815

818816
max_data = umin(max_mtu, peer->max_data);

net/rxrpc/peer_event.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, unsigned int mtu)
130130
peer->pmtud_bad = max_data + 1;
131131

132132
trace_rxrpc_pmtud_reduce(peer, 0, max_data, rxrpc_pmtud_reduce_icmp);
133-
write_seqcount_begin(&peer->mtu_lock);
134133
peer->max_data = max_data;
135-
write_seqcount_end(&peer->mtu_lock);
136134
}
137135
}
138136

@@ -408,13 +406,8 @@ void rxrpc_input_probe_for_pmtud(struct rxrpc_connection *conn, rxrpc_serial_t a
408406
}
409407

410408
max_data = umin(max_data, peer->ackr_max_data);
411-
if (max_data != peer->max_data) {
412-
preempt_disable();
413-
write_seqcount_begin(&peer->mtu_lock);
409+
if (max_data != peer->max_data)
414410
peer->max_data = max_data;
415-
write_seqcount_end(&peer->mtu_lock);
416-
preempt_enable();
417-
}
418411

419412
jumbo = max_data + sizeof(struct rxrpc_jumbo_header);
420413
jumbo /= RXRPC_JUMBO_SUBPKTLEN;

net/rxrpc/peer_object.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ struct rxrpc_peer *rxrpc_alloc_peer(struct rxrpc_local *local, gfp_t gfp,
235235
peer->service_conns = RB_ROOT;
236236
seqlock_init(&peer->service_conn_lock);
237237
spin_lock_init(&peer->lock);
238-
seqcount_init(&peer->mtu_lock);
239238
peer->debug_id = atomic_inc_return(&rxrpc_debug_id);
240239
peer->recent_srtt_us = UINT_MAX;
241240
peer->cong_ssthresh = RXRPC_TX_MAX_WINDOW;

0 commit comments

Comments
 (0)