From: Rusty Russell <rusty@rustcorp.com.au>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH 0/3] tun: fix aio
Date: Tue, 5 May 2009 12:48:13 +0930 [thread overview]
Message-ID: <200905051248.14014.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090427093455.GA29082@redhat.com>
On Mon, 27 Apr 2009 07:04:55 pm Michael S. Tsirkin wrote:
> On Mon, Apr 27, 2009 at 10:48:37AM +0930, Rusty Russell wrote:
> > > Sure. Here it is: much smaller, but slightly slower.
> >
> > Which could probably be fixed by using an on-stack version for a iovec
> > of less than a certain size...
>
> I agree that for large message sizes the malloc would probably be
> dwarfed by the cost of memory copy. However a large iovec might pass a
> small message, might it not?
Sorry, I didn't make myself clear. Something like:
struct iovec smalliov[512 / sizeof(struct iovec)];
if (count < ARRAY_SIZE(smalliov)) {
iv = smalliov;
} else {
iv = kmalloc(...)
}
...
if (iv != smalliov)
kfree(iv);
Cheers,
Rusty.
next prev parent reply other threads:[~2009-05-05 4:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-20 11:25 [PATCH 0/3] tun: fix aio Michael S. Tsirkin
2009-04-20 12:09 ` Herbert Xu
2009-04-20 12:21 ` Michael S. Tsirkin
2009-04-27 1:18 ` Rusty Russell
2009-04-27 9:34 ` Michael S. Tsirkin
2009-05-05 3:18 ` Rusty Russell [this message]
2009-05-05 8:40 ` Michael S. Tsirkin
2009-04-21 12:50 ` Michael S. Tsirkin
2009-04-21 13:02 ` David Miller
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=200905051248.14014.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=mst@redhat.com \
--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 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).