From: Max Kellermann Date: Mon, 7 Oct 2024 17:13:41 +0000 (+0200) Subject: msg/async/ProtocolV2: call KeepAliveFrameAck::Encode() without `write_lock` X-Git-Tag: v20.0.0~233^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e2798ecb69b1d60c5dc1a90c9d65cb79f11a5e22;p=ceph.git msg/async/ProtocolV2: call KeepAliveFrameAck::Encode() without `write_lock` Reduce lock time/contention. Signed-off-by: Max Kellermann --- diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 0ca8afcad25..1ac4c1ae311 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -1653,8 +1653,8 @@ CtPtr ProtocolV2::handle_keepalive2(ceph::bufferlist &payload) ldout(cct, 30) << __func__ << " got KEEPALIVE2 tag ..." << dendl; - connection->write_lock.lock(); auto keepalive_ack_frame = KeepAliveFrameAck::Encode(keepalive_frame.timestamp()); + connection->write_lock.lock(); if (!append_frame(keepalive_ack_frame)) { connection->write_lock.unlock(); return _fault();