From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 1/2] splice02: Generate input in C
Date: Fri, 16 Apr 2021 15:10:07 +0200 [thread overview]
Message-ID: <YHmMr/8QB8RByu+l@pevik> (raw)
In-Reply-To: <YHmD6Efvn/f6Eh+G@yuki>
Hi Cyril,
...
> > Maybe one more change: INT_MAX is a bit too much, it timeouts.
> > I'll use 262144 as max allowed -n (the default on intel - 2x max pipe size).
> I guess that the main problem here is that we write one character at a
> time, which means that we spend most of the time in syscall handler code
> rather than copying the data. It may work much better if we change the
> code to write 512 bytes at a time. I.e. something as:
Sounds very reasonable, thx! I'll send v4.
Kind regards,
Petr
> #define BUFSIZE 512
> char buf[BUFSIZE];
> memset(buf, 'a', BUFSIZE);
> while (to_write > 0) {
> size_t size = to_write > BUFSIZE ? BUFSIZE : to_write;
> ...
> to_write -= written;
> }
prev parent reply other threads:[~2021-04-16 13:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 4:38 [LTP] [PATCH v3 1/2] splice02: Generate input in C Petr Vorel
2021-04-13 4:38 ` [LTP] [PATCH v3 2/2] commands: Add shell pipe test Petr Vorel
2021-04-15 13:46 ` [LTP] [PATCH v3 1/2] splice02: Generate input in C Cyril Hrubis
2021-04-15 14:11 ` Petr Vorel
2021-04-15 14:27 ` Petr Vorel
2021-04-16 12:32 ` Cyril Hrubis
2021-04-16 13:10 ` Petr Vorel [this message]
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=YHmMr/8QB8RByu+l@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/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