[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090115233220.GD1123@1wt.eu>
Date: Fri, 16 Jan 2009 00:32:20 +0100
From: Willy Tarreau <w@....eu>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: David Miller <davem@...emloft.net>, jarkao2@...il.com,
zbr@...emap.net, dada1@...mosbay.com, ben@...s.com, mingo@...e.hu,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
jens.axboe@...cle.com
Subject: Re: [PATCH] tcp: splice as many packets as possible at once
On Fri, Jan 16, 2009 at 10:19:35AM +1100, Herbert Xu wrote:
> On Fri, Jan 16, 2009 at 12:03:31AM +0100, Willy Tarreau wrote:
> >
> > I'm leaving the patch below for comments, maybe someone will spot
> > something ? Don't we need at least one kfree() somewhere to match
> > alloc_pages() ?
>
> Indeed.
>
> > > static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page,
> > > unsigned int len, unsigned int offset,
> > > - struct sk_buff *skb)
> > > + struct sk_buff *skb, int linear)
> > > {
> > > if (unlikely(spd->nr_pages == PIPE_BUFFERS))
> > > return 1;
> > >
> > > + if (linear) {
> > > + page = linear_to_page(page, len, offset);
> > > + if (!page)
> > > + return 1;
> > > + }
> > > +
> > > spd->pages[spd->nr_pages] = page;
> > > spd->partial[spd->nr_pages].len = len;
> > > spd->partial[spd->nr_pages].offset = offset;
> > > - spd->partial[spd->nr_pages].private = (unsigned long) skb_get(skb);
> > > spd->nr_pages++;
> > > + get_page(page);
>
> This get_page needs to be moved into an else clause of the previous
> if block.
Good catch Herbert, it's working fine now. The performance I get
(30.6 MB/s) is between the original splice version (24.1) and the
recently optimized one (35.7). That's not that bad considering
we're copying the data.
Cheers,
Willy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists