From: Al Viro <viro@ZenIV.linux.org.uk>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <kafai@fb.com>
Subject: Re: sendfile from 9p fs into af_alg
Date: Wed, 23 Nov 2016 15:53:01 +0000 [thread overview]
Message-ID: <20161123155301.GP1555@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20161123085809.GA46992@ast-mbp.thefacebook.com>
On Wed, Nov 23, 2016 at 12:58:11AM -0800, Alexei Starovoitov wrote:
> if I read it correctly 9p actually responded with 8192 bytes of requests...
> whereas the file size was 9624.
> For large file sizes (in megabytes) the difference between what
> sendfile is reporting and actual file size can be 3x.
> In the small file case (like above dump) it looks rounded to page size for some reason.
OK, I think I see one bug in there; could you check if this gets it back to
normal?
diff --git a/fs/splice.c b/fs/splice.c
index dcaf185..5a7750b 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -408,7 +408,8 @@ static ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
if (res <= 0)
return -ENOMEM;
- nr_pages = res / PAGE_SIZE;
+ BUG_ON(dummy);
+ nr_pages = DIV_ROUND_UP(res, PAGE_SIZE);
vec = __vec;
if (nr_pages > PIPE_DEF_BUFFERS) {
next prev parent reply other threads:[~2016-11-23 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 3:58 sendfile from 9p fs into af_alg Alexei Starovoitov
2016-11-23 4:46 ` Al Viro
2016-11-23 4:55 ` Alexei Starovoitov
2016-11-23 6:16 ` Al Viro
2016-11-23 8:58 ` Alexei Starovoitov
2016-11-23 15:53 ` Al Viro [this message]
2016-11-23 16:29 ` Alexei Starovoitov
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=20161123155301.GP1555@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.