linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Tariq Toukan <ttoukan.linux@gmail.com>
Cc: dhowells@redhat.com, Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	David Ahern <dsahern@kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	Jens Axboe <axboe@kernel.dk>, Jeff Layton <jlayton@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	Chuck Lever III <chuck.lever@oracle.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Boris Pismenny <borisp@nvidia.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Gal Pressman <gal@nvidia.com>,
	ranro@nvidia.com, samiram@nvidia.com, drort@nvidia.com,
	Tariq Toukan <tariqt@nvidia.com>
Subject: Re: [PATCH net-next v10 08/16] tls: Inline do_tcp_sendpages()
Date: Thu, 10 Aug 2023 14:07:49 +0100	[thread overview]
Message-ID: <3480243.1691672869@warthog.procyon.org.uk> (raw)
In-Reply-To: <f0538006-6641-eaf6-b7b5-b3ef57afc652@gmail.com>

Tariq Toukan <ttoukan.linux@gmail.com> wrote:

> We are collecting more info on how the repro is affected by the different
> parameters.

I'm wondering if userspace is feeding the unspliceable page in somehow.  Could
you try running with the attached changes?  It might help catch the point at
which the offending page is first spliced into the pipe and any backtrace
might help localise the driver that's producing it.

Thanks,
David
---
diff --git a/fs/splice.c b/fs/splice.c
index 3e2a31e1ce6a..877df1de3863 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -218,6 +218,8 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
 	while (!pipe_full(head, tail, pipe->max_usage)) {
 		struct pipe_buffer *buf = &pipe->bufs[head & mask];
 
+		WARN_ON_ONCE(!sendpage_ok(spd->pages[page_nr]));
+
 		buf->page = spd->pages[page_nr];
 		buf->offset = spd->partial[page_nr].offset;
 		buf->len = spd->partial[page_nr].len;
@@ -252,6 +254,8 @@ ssize_t add_to_pipe(struct pipe_inode_info *pipe, struct pipe_buffer *buf)
 	unsigned int mask = pipe->ring_size - 1;
 	int ret;
 
+	WARN_ON_ONCE(!sendpage_ok(buf->page));
+
 	if (unlikely(!pipe->readers)) {
 		send_sig(SIGPIPE, current, 0);
 		ret = -EPIPE;
@@ -861,6 +865,8 @@ ssize_t splice_to_socket(struct pipe_inode_info *pipe, struct file *out,
 				break;
 			}
 
+			WARN_ON_ONCE(!sendpage_ok(buf->page));
+
 			bvec_set_page(&bvec[bc++], buf->page, seg, buf->offset);
 			remain -= seg;
 			if (remain == 0 || bc >= ARRAY_SIZE(bvec))
@@ -1411,6 +1417,8 @@ static int iter_to_pipe(struct iov_iter *from,
 		for (i = 0; i < n; i++) {
 			int size = min_t(int, left, PAGE_SIZE - start);
 
+			WARN_ON_ONCE(!sendpage_ok(pages[i]));
+
 			buf.page = pages[i];
 			buf.offset = start;
 			buf.len = size;


  parent reply	other threads:[~2023-08-10 13:08 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22 12:11 [PATCH net-next v10 00/16] splice, net: Replace sendpage with sendmsg(MSG_SPLICE_PAGES), part 1 David Howells
2023-05-22 12:11 ` [PATCH net-next v10 01/16] net: Declare MSG_SPLICE_PAGES internal sendmsg() flag David Howells
2023-05-22 12:11 ` [PATCH net-next v10 02/16] net: Pass max frags into skb_append_pagefrags() David Howells
2023-05-22 12:11 ` [PATCH net-next v10 03/16] net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES David Howells
2023-05-24 12:24   ` Yunsheng Lin
2023-05-24 13:21   ` David Howells
2023-05-22 12:11 ` [PATCH net-next v10 04/16] tcp: Support MSG_SPLICE_PAGES David Howells
2023-05-22 12:11 ` [PATCH net-next v10 05/16] tcp: Convert do_tcp_sendpages() to use MSG_SPLICE_PAGES David Howells
2023-05-22 12:11 ` [PATCH net-next v10 06/16] tcp_bpf: Inline do_tcp_sendpages as it's now a wrapper around tcp_sendmsg David Howells
2023-05-22 12:11 ` [PATCH net-next v10 07/16] espintcp: Inline do_tcp_sendpages() David Howells
2023-05-22 12:11 ` [PATCH net-next v10 08/16] tls: " David Howells
2023-06-07 14:17   ` Tariq Toukan
2023-06-07 15:03   ` David Howells
2023-06-13 11:15     ` Tariq Toukan
2023-06-19  8:23       ` Tariq Toukan
2023-06-19  9:35       ` David Howells
2023-06-27 16:49         ` Tariq Toukan
2023-06-30 17:21           ` Jakub Kicinski
2023-07-04 20:06             ` Tariq Toukan
2023-07-05 16:19               ` Jakub Kicinski
2023-07-23  6:35                 ` Tariq Toukan
2023-07-26  0:30                   ` Jakub Kicinski
2023-07-26 19:20                     ` Tariq Toukan
2023-07-26 20:08                       ` Jakub Kicinski
2023-08-03 11:52                         ` Tariq Toukan
2023-08-03 11:47                     ` Tariq Toukan
2023-08-04  3:12                       ` Jakub Kicinski
2023-08-08  7:29                         ` Tariq Toukan
2023-07-26 10:51                 ` David Howells
2023-07-26 11:43                   ` Tariq Toukan
2023-07-26 14:57                     ` Jakub Kicinski
2023-08-10 13:07             ` David Howells [this message]
2023-06-27 16:55         ` David Howells
2023-06-27 17:06         ` David Howells
2023-05-22 12:11 ` [PATCH net-next v10 09/16] siw: " David Howells
2023-05-22 12:11 ` [PATCH net-next v10 10/16] tcp: Fold do_tcp_sendpages() into tcp_sendpage_locked() David Howells
2023-05-22 12:11 ` [PATCH net-next v10 11/16] ip, udp: Support MSG_SPLICE_PAGES David Howells
2023-05-22 12:11 ` [PATCH net-next v10 12/16] ip6, udp6: " David Howells
2023-05-22 12:11 ` [PATCH net-next v10 13/16] udp: Convert udp_sendpage() to use MSG_SPLICE_PAGES David Howells
2023-05-22 12:11 ` [PATCH net-next v10 14/16] ip: Remove ip_append_page() David Howells
2023-05-22 12:11 ` [PATCH net-next v10 15/16] af_unix: Support MSG_SPLICE_PAGES David Howells
2023-05-22 12:11 ` [PATCH net-next v10 16/16] unix: Convert unix_stream_sendpage() to use MSG_SPLICE_PAGES David Howells
2023-05-24  4:20 ` [PATCH net-next v10 00/16] splice, net: Replace sendpage with sendmsg(MSG_SPLICE_PAGES), part 1 patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3480243.1691672869@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=borisp@nvidia.com \
    --cc=brauner@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=davem@davemloft.net \
    --cc=drort@nvidia.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=hch@infradead.org \
    --cc=jlayton@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ranro@nvidia.com \
    --cc=samiram@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=torvalds@linux-foundation.org \
    --cc=ttoukan.linux@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).