From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48C634C9564 for ; Tue, 19 May 2026 10:23:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779186218; cv=none; b=EIvnSQhZAb+y/c8y6+pOkODhgqR37dL8wyGop5mxi1+LvstMOPl3E1hxUADVZTuTLlh3J0N14QXAIAf7lFrUvbHjnU8dS5qy+SDEfE/Y6VhQDbLpZcRxAjTUHH52xHhbeIOCp1AUROwRyUodAbfIMnvZaxgRbhFg2maO8GKgZds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779186218; c=relaxed/simple; bh=0C0oxU5WSjFNdDxdnVtbUM7f6dBk/2BN9/tB3L8uuig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=KEqgpeeEd/hO4gDliS8zxqzr4zEc1Of/i2XG6Y344x/RY8dCtHsLRmqqahBFpXBKuapZA1VswD4Tket+HY8mKEefVl+0ApwaztPQKDoKoi4Nh6FdnqDxGVWUTXnzpn+Vo9ejfW33MzG3s3WqBwlfOtp3ICDYEPlazfw2uRgLcyg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dhcwRLqL; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dhcwRLqL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779186215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qznz4sKC7x1xRadlwZi8CnPQ8HiiD1rNpPtHaviUXUo=; b=dhcwRLqLm2qBoS5mYSYf17ia7KA0i46/Nt6fe6L50014l7BthGluzX4NgD5Rdf4yhiYRZx KvYVEgwIFxmKSy4zBhyC+HA+tCW4vqnIYjx2Rkh7/cUC5whawMKPPE9Th2On/f52zP+pot +ZS/z7dEn0IqDnsphUgIuqXQBFVuQao= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-32-NbkSoDhPMi-ejqUt3dBuKg-1; Tue, 19 May 2026 06:23:31 -0400 X-MC-Unique: NbkSoDhPMi-ejqUt3dBuKg-1 X-Mimecast-MFC-AGG-ID: NbkSoDhPMi-ejqUt3dBuKg_1779186210 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2FE1218002E0; Tue, 19 May 2026 10:23:30 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.48.33]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0A08418004A3; Tue, 19 May 2026 10:23:26 +0000 (UTC) From: David Howells To: Steve French Cc: David Howells , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Stefan Metzmacher , Mina Almasry , linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, netfs@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH 17/36] cifs: Don't use corking Date: Tue, 19 May 2026 11:21:35 +0100 Message-ID: <20260519102158.592165-18-dhowells@redhat.com> In-Reply-To: <20260519102158.592165-1-dhowells@redhat.com> References: <20260519102158.592165-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: netfs@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: _2WZ98wOozVLhzehy6rTmIMRk1gUArW4YLuaPAXymKY_1779186210 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true We don't need to cork the TCP socket if we send each message in a single sendmsg() and set MSG_EOR to mark the last packet of the message with a don't-append flag. Signed-off-by: David Howells cc: Steve French cc: Paulo Alcantara cc: Shyam Prasad N cc: Tom Talpey cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/smb/client/transport.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/smb/client/transport.c b/fs/smb/client/transport.c index 3ead26f76112..e43fce1099a9 100644 --- a/fs/smb/client/transport.c +++ b/fs/smb/client/transport.c @@ -271,9 +271,11 @@ static int smb_sendmsg(struct TCP_Server_Info *server, const struct iov_iter *it struct msghdr msg = { /* * MSG_SPLICE_PAGES causes tcp_sendmsg() to splice in the pages - * in the iterator rather than copying from them. + * in the iterator rather than copying from them; MSG_EOR + * indicates that the last TCP packet we create should be + * marked no-append with regards to the next sendmsg. */ - .msg_flags = MSG_NOSIGNAL | MSG_SPLICE_PAGES, + .msg_flags = MSG_NOSIGNAL | MSG_SPLICE_PAGES | MSG_EOR, .msg_iter = *iter, }; int retries = 0; @@ -362,10 +364,6 @@ __smb_send_rqst(struct TCP_Server_Info *server, struct iov_iter *iter) goto out; } - rc = 0; - /* cork the socket */ - tcp_sock_set_cork(ssocket->sk, true); - /* * We should not allow signals to interrupt the network send because * any partial send will cause session reconnects thus increasing @@ -381,9 +379,6 @@ __smb_send_rqst(struct TCP_Server_Info *server, struct iov_iter *iter) sigprocmask(SIG_SETMASK, &oldmask, NULL); - /* uncork it */ - tcp_sock_set_cork(ssocket->sk, false); - if (sent > 0) { /* * If signal is pending but we have already sent the whole