[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241210081721.66479-1-kuniyu@amazon.com>
Date: Tue, 10 Dec 2024 17:17:21 +0900
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <deweerdt.lkml@...il.com>
CC: <David.Laight@...LAB.COM>, <davem@...emloft.net>, <dhowells@...hat.com>,
<edumazet@...gle.com>, <horms@...nel.org>, <jdamato@...tly.com>,
<kuba@...nel.org>, <kuniyu@...zon.com>, <linux-kernel@...r.kernel.org>,
<mhal@...x.co>, <netdev@...r.kernel.org>, <pabeni@...hat.com>,
<stable@...r.kernel.org>, <xiyou.wangcong@...il.com>
Subject: Re: [PATCH v2 net] splice: do not checksum AF_UNIX sockets
From: Frederik Deweerdt <deweerdt.lkml@...il.com>
Date: Mon, 9 Dec 2024 21:06:48 -0800
> When `skb_splice_from_iter` was introduced, it inadvertently added
> checksumming for AF_UNIX sockets. This resulted in significant
> slowdowns, for example when using sendfile over unix sockets.
>
> Using the test code in [1] in my test setup (2G single core qemu),
> the client receives a 1000M file in:
> - without the patch: 1482ms (+/- 36ms)
> - with the patch: 652.5ms (+/- 22.9ms)
>
> This commit addresses the issue by marking checksumming as unnecessary in
> `unix_stream_sendmsg`
>
> Cc: stable@...r.kernel.org
> Signed-off-by: Frederik Deweerdt <deweerdt.lkml@...il.com>
> Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")
> ---
For the future submission, it would be nice to explain changes
between versions and add the old patch link under '---' here.
The patch itself looks good to me.
Reviewed-by: Kuniyuki Iwashima <kuniyu@...zon.com>
> net/unix/af_unix.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 001ccc55ef0f..6b1762300443 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -2313,6 +2313,7 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
> fds_sent = true;
>
> if (unlikely(msg->msg_flags & MSG_SPLICE_PAGES)) {
> + skb->ip_summed = CHECKSUM_UNNECESSARY;
> err = skb_splice_from_iter(skb, &msg->msg_iter, size,
> sk->sk_allocation);
> if (err < 0) {
> --
> 2.44.1
Powered by blists - more mailing lists