Re: [PATCH][RFC] network splice receive v3

2007-07-19 Thread Jens Axboe
On Thu, Jul 19 2007, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > Hello. > > In article <[EMAIL PROTECTED]> (at Wed, 11 Jul 2007 11:19:27 +0200), Jens > Axboe <[EMAIL PROTECTED]> says: > > > @@ -835,6 +835,7 @@ const struct proto_ops inet_stream_ops = { > > .recvmsg = sock_common_recvm

Re: [PATCH][RFC] network splice receive v3

2007-07-19 Thread YOSHIFUJI Hideaki / 吉藤英明
Hello. In article <[EMAIL PROTECTED]> (at Wed, 11 Jul 2007 11:19:27 +0200), Jens Axboe <[EMAIL PROTECTED]> says: > @@ -835,6 +835,7 @@ const struct proto_ops inet_stream_ops = { > .recvmsg = sock_common_recvmsg, > .mmap = sock_no_mmap, > .sendpage

Re: [PATCH][RFC] network splice receive v3

2007-07-19 Thread Evgeniy Polyakov
Hi. On Fri, Jul 13, 2007 at 02:21:00PM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > > It really looks like the last tree we tested, so if you think additional > > one will not hurt, feel free to ping, so I will completely rebase > > testing tree. > > It would be great if you could retest! There

Re: [PATCH][RFC] network splice receive v3

2007-07-13 Thread Jens Axboe
On Thu, Jul 12 2007, Evgeniy Polyakov wrote: > On Wed, Jul 11, 2007 at 11:19:27AM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > Hi, > > Hi Jens. > > > Here's an updated implementation of tcp network splice receive support. > > It actually works for me now, no data corruption seen. > > > >

Re: [PATCH][RFC] network splice receive v3

2007-07-12 Thread Evgeniy Polyakov
On Wed, Jul 11, 2007 at 11:19:27AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > Hi, Hi Jens. > Here's an updated implementation of tcp network splice receive support. > It actually works for me now, no data corruption seen. > > For the original announcement and how to test it, see: > > http:/

Re: [PATCH][RFC] network splice receive v3

2007-07-11 Thread Jens Axboe
On Wed, Jul 11 2007, Joel Becker wrote: > On Wed, Jul 11, 2007 at 11:19:27AM +0200, Jens Axboe wrote: > > Subject: [PATCH] splice: don't assume regular pages in splice_to_pipe() > > > > Allow caller to pass in a release function, there might be > > other resources that need releasing as well. Need

Re: [PATCH][RFC] network splice receive v3

2007-07-11 Thread Joel Becker
On Wed, Jul 11, 2007 at 11:19:27AM +0200, Jens Axboe wrote: > Subject: [PATCH] splice: don't assume regular pages in splice_to_pipe() > > Allow caller to pass in a release function, there might be > other resources that need releasing as well. Needed for > network receive. > > diff --git a/fs/spl

[PATCH][RFC] network splice receive v3

2007-07-11 Thread Jens Axboe
Hi, Here's an updated implementation of tcp network splice receive support. It actually works for me now, no data corruption seen. For the original announcement and how to test it, see: http://marc.info/?l=linux-netdev&m=118103093400770&w=2 The splice core changes needed to support this are now

Re: [PATCH][RFC] network splice receive v2

2007-06-15 Thread Jens Axboe
On Fri, Jun 15 2007, Evgeniy Polyakov wrote: > On Fri, Jun 15, 2007 at 11:34:30AM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > > Both spd->nr_pages and page_nr are equal to 1. When spd->nr_pages > > > was 2 there was only 1 free slot in pipe_buffer. > > > > Ah duh, indeed, it is a dumb bug

Re: [PATCH][RFC] network splice receive v2

2007-06-15 Thread Evgeniy Polyakov
On Fri, Jun 15, 2007 at 11:34:30AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > > Both spd->nr_pages and page_nr are equal to 1. When spd->nr_pages > > was 2 there was only 1 free slot in pipe_buffer. > > Ah duh, indeed, it is a dumb bug indeed. This should work. Yep, this one works too. > dif

Re: [PATCH][RFC] network splice receive v2

2007-06-15 Thread Jens Axboe
On Fri, Jun 15 2007, Evgeniy Polyakov wrote: > On Fri, Jun 15, 2007 at 10:43:18AM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > > So, things turned down to be not in the __splice_from_pipe(), but > > > splice_to_pipe(). Attached patch fixes a leak for me. > > > It was tested with different da

Re: [PATCH][RFC] network splice receive v2

2007-06-15 Thread Evgeniy Polyakov
On Fri, Jun 15, 2007 at 10:43:18AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > > So, things turned down to be not in the __splice_from_pipe(), but > > splice_to_pipe(). Attached patch fixes a leak for me. > > It was tested with different data files and all were received correctly. > > > > Signe

Re: [PATCH][RFC] network splice receive v2

2007-06-15 Thread Jens Axboe
On Fri, Jun 15 2007, Evgeniy Polyakov wrote: > On Thu, Jun 14, 2007 at 01:59:02PM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > On Thu, Jun 14 2007, Evgeniy Polyakov wrote: > > > On Wed, Jun 13, 2007 at 12:01:04PM +0400, Evgeniy Polyakov ([EMAIL > > > PROTECTED]) wrote: > > > > I will rebase

Re: [PATCH][RFC] network splice receive v2

2007-06-15 Thread Evgeniy Polyakov
On Thu, Jun 14, 2007 at 01:59:02PM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > On Thu, Jun 14 2007, Evgeniy Polyakov wrote: > > On Wed, Jun 13, 2007 at 12:01:04PM +0400, Evgeniy Polyakov ([EMAIL > > PROTECTED]) wrote: > > > I will rebase my tree, likely something was not merged correctly. > >

Re: [PATCH][RFC] network splice receive v2

2007-06-14 Thread Jens Axboe
On Thu, Jun 14 2007, Evgeniy Polyakov wrote: > On Wed, Jun 13, 2007 at 12:01:04PM +0400, Evgeniy Polyakov ([EMAIL > PROTECTED]) wrote: > > I will rebase my tree, likely something was not merged correctly. > > Ok, I've just rebased a tree from recent git and pulled from brick - > things seems to b

Re: [PATCH][RFC] network splice receive v2

2007-06-14 Thread Evgeniy Polyakov
On Wed, Jun 13, 2007 at 12:01:04PM +0400, Evgeniy Polyakov ([EMAIL PROTECTED]) wrote: > I will rebase my tree, likely something was not merged correctly. Ok, I've just rebased a tree from recent git and pulled from brick - things seems to be settled. I've ran several tests with different filesize

Re: [PATCH][RFC] network splice receive v2

2007-06-13 Thread Jens Axboe
On Wed, Jun 13 2007, Evgeniy Polyakov wrote: > On Tue, Jun 12, 2007 at 08:17:32PM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > On Tue, Jun 12 2007, Evgeniy Polyakov wrote: > > > On Mon, Jun 11, 2007 at 01:59:26PM +0200, Jens Axboe ([EMAIL PROTECTED]) > > > wrote: > > > > Patches are against

Re: [PATCH][RFC] network splice receive v2

2007-06-13 Thread Evgeniy Polyakov
On Tue, Jun 12, 2007 at 08:17:32PM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > On Tue, Jun 12 2007, Evgeniy Polyakov wrote: > > On Mon, Jun 11, 2007 at 01:59:26PM +0200, Jens Axboe ([EMAIL PROTECTED]) > > wrote: > > > Patches are against the #splice branch of the block repo, "official" url > >

Re: [PATCH][RFC] network splice receive v2

2007-06-12 Thread Jens Axboe
On Tue, Jun 12 2007, Evgeniy Polyakov wrote: > On Mon, Jun 11, 2007 at 01:59:26PM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > Patches are against the #splice branch of the block repo, "official" url > > of that is: > > > > git://git.kernel.dk/data/git/linux-2.6-block.git/ > > > > and it's

Re: [PATCH][RFC] network splice receive v2

2007-06-12 Thread Jens Axboe
On Tue, Jun 12 2007, Jens Axboe wrote: > On Tue, Jun 12 2007, Evgeniy Polyakov wrote: > > On Mon, Jun 11, 2007 at 01:59:26PM +0200, Jens Axboe ([EMAIL PROTECTED]) > > wrote: > > > Patches are against the #splice branch of the block repo, "official" url > > > of that is: > > > > > > git://git.kern

Re: [PATCH][RFC] network splice receive v2

2007-06-12 Thread Evgeniy Polyakov
On Mon, Jun 11, 2007 at 01:59:26PM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > Patches are against the #splice branch of the block repo, "official" url > of that is: > > git://git.kernel.dk/data/git/linux-2.6-block.git/ > > and it's based on Linus main tree. Let me know if I should supply netd

Re: [PATCH][RFC] network splice receive

2007-06-12 Thread Jens Axboe
On Tue, Jun 12 2007, Evgeniy Polyakov wrote: > > difference between changing parts of the elements of a structure to just > > grabbing a reference to it. If the skb cannot be referenced, skb_get() > > should return NULL. > > > > But that aside, I see the issue. I'll just stick to the clone, it wor

Re: [PATCH][RFC] network splice receive

2007-06-12 Thread Evgeniy Polyakov
On Tue, Jun 12, 2007 at 02:40:05PM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > On Tue, Jun 12 2007, Evgeniy Polyakov wrote: > > > > > > and putting cloned skb into private field instead of > > > > > > original on in spd_fill_page() ends up without kernel hung. > > > > > > > > > > Why? Seems po

Re: [PATCH][RFC] network splice receive

2007-06-12 Thread Jens Axboe
On Tue, Jun 12 2007, Evgeniy Polyakov wrote: > > > > > and putting cloned skb into private field instead of > > > > > original on in spd_fill_page() ends up without kernel hung. > > > > > > > > Why? Seems pointless to allocate a clone just to hold on to the skb, a > > > > reference should be equa

Re: [PATCH][RFC] network splice receive

2007-06-12 Thread Evgeniy Polyakov
On Tue, Jun 12, 2007 at 01:33:54PM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > > I had a crashdump, where page was released via splice_to_pipe() indeed, > > I did not investigate if it is possible to release provided page in > > other places. I think if in future there will other slab usage case

Re: [PATCH][RFC] network splice receive

2007-06-12 Thread Jens Axboe
On Tue, Jun 12 2007, Evgeniy Polyakov wrote: > On Sat, Jun 09, 2007 at 08:36:09AM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > On Fri, Jun 08 2007, Evgeniy Polyakov wrote: > > > On Fri, Jun 08, 2007 at 06:57:25PM +0400, Evgeniy Polyakov ([EMAIL > > > PROTECTED]) wrote: > > > > I will try so

Re: [PATCH][RFC] network splice receive

2007-06-12 Thread Evgeniy Polyakov
On Sat, Jun 09, 2007 at 08:36:09AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > On Fri, Jun 08 2007, Evgeniy Polyakov wrote: > > On Fri, Jun 08, 2007 at 06:57:25PM +0400, Evgeniy Polyakov ([EMAIL > > PROTECTED]) wrote: > > > I will try some things for the nearest 30-60 minutes, and then will mov

[PATCH][RFC] network splice receive v2

2007-06-11 Thread Jens Axboe
Hi, Here's an updated implementation of tcp network splice receive support. It actually works for me now, no data corruption seen. For the original announcement and how to test it, see: http://marc.info/?l=linux-netdev&m=118103093400770&w=2 I hang on to the original skb by creating a clone of i

Re: [PATCH][RFC] network splice receive

2007-06-11 Thread Jens Axboe
On Fri, Jun 08 2007, Evgeniy Polyakov wrote: > Size of the received file is bigger than file sent, file contains repeated > blocks of data sometimes. Cloned skb usage is likely too big overhead, > although for receiving fast clone is unused in most cases, so there > might be some gain. That was ac

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Jens Axboe
On Fri, Jun 08 2007, Evgeniy Polyakov wrote: > On Fri, Jun 08, 2007 at 06:57:25PM +0400, Evgeniy Polyakov ([EMAIL > PROTECTED]) wrote: > > I will try some things for the nearest 30-60 minutes, and then will move to > > canoe trip until thuesday, so will not be able to work on this idea. > > Ok, r

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Evgeniy Polyakov
On Fri, Jun 08, 2007 at 06:57:25PM +0400, Evgeniy Polyakov ([EMAIL PROTECTED]) wrote: > I will try some things for the nearest 30-60 minutes, and then will move to > canoe trip until thuesday, so will not be able to work on this idea. Ok, replacing in fs/splice.c every page_cache_release() with s

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Jens Axboe
On Fri, Jun 08 2007, Evgeniy Polyakov wrote: > On Fri, Jun 08, 2007 at 04:14:52PM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > Here's a start, for the splice side at least of storing a buf-private > > entity with the ops. > > :) I tested the same implementation, but I put skb pointer into >

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Evgeniy Polyakov
On Fri, Jun 08, 2007 at 04:14:52PM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > Here's a start, for the splice side at least of storing a buf-private > entity with the ops. :) I tested the same implementation, but I put skb pointer into page->private. My approach is not correct, since the same p

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Jens Axboe
On Fri, Jun 08 2007, Evgeniy Polyakov wrote: > On Fri, Jun 08, 2007 at 11:04:40AM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > OK, so a delayed empty of the pipe could end up causing packet drops > > elsewhere due to allocation exhaustion? > > Yes. > > > > > We can grow the pipe, should we

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Evgeniy Polyakov
On Fri, Jun 08, 2007 at 11:04:40AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > OK, so a delayed empty of the pipe could end up causing packet drops > elsewhere due to allocation exhaustion? Yes. > > > We can grow the pipe, should we have to. So instead of blocking waiting > > > on reader consu

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Jens Axboe
On Fri, Jun 08 2007, Evgeniy Polyakov wrote: > On Fri, Jun 08, 2007 at 10:38:53AM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > On Fri, Jun 08 2007, David Miller wrote: > > > From: Jens Axboe <[EMAIL PROTECTED]> > > > Date: Fri, 8 Jun 2007 09:48:24 +0200 > > > > > > > Perhaps it's possible t

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Evgeniy Polyakov
On Fri, Jun 08, 2007 at 10:38:53AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > On Fri, Jun 08 2007, David Miller wrote: > > From: Jens Axboe <[EMAIL PROTECTED]> > > Date: Fri, 8 Jun 2007 09:48:24 +0200 > > > > > Perhaps it's possible to solve this at a different level - can we hang > > > on to

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Jens Axboe
On Fri, Jun 08 2007, David Miller wrote: > From: Jens Axboe <[EMAIL PROTECTED]> > Date: Fri, 8 Jun 2007 09:48:24 +0200 > > > Perhaps it's possible to solve this at a different level - can we hang > > on to the skb until the pipe buffer has been consumed, and prevent reuse > > that way? Then we don

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread David Miller
From: Jens Axboe <[EMAIL PROTECTED]> Date: Fri, 8 Jun 2007 09:48:24 +0200 > Perhaps it's possible to solve this at a different level - can we hang > on to the skb until the pipe buffer has been consumed, and prevent reuse > that way? Then we don't have to care what backing the skb has, as long > a

Re: [PATCH][RFC] network splice receive

2007-06-08 Thread Jens Axboe
On Thu, Jun 07 2007, Evgeniy Polyakov wrote: > On Thu, Jun 07, 2007 at 12:51:59PM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > > What bout checking if page belongs to kmalloc cache (or any other cache > > > via priviate pointers) and do not perform any kind of reference counting > > > on the

Re: [PATCH][RFC] network splice receive

2007-06-07 Thread Evgeniy Polyakov
On Thu, Jun 07, 2007 at 12:51:59PM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > > What bout checking if page belongs to kmalloc cache (or any other cache > > via priviate pointers) and do not perform any kind of reference counting > > on them? I will play with this a bit later today. > > That mi

Re: [PATCH][RFC] network splice receive

2007-06-07 Thread Jens Axboe
On Thu, Jun 07 2007, Evgeniy Polyakov wrote: > On Wed, Jun 06, 2007 at 09:17:25AM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > > Some pages have zero reference counter here. > > > > But it's somewhat annoying to get pages with zero reference counts > > there, I wonder how that happens. I gu

Re: [PATCH][RFC] network splice receive

2007-06-07 Thread Evgeniy Polyakov
On Wed, Jun 06, 2007 at 09:17:25AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > > Some pages have zero reference counter here. > > But it's somewhat annoying to get pages with zero reference counts > there, I wonder how that happens. I guess if the skb->data originated > from kmalloc() then we d

Re: [PATCH][RFC] network splice receive

2007-06-06 Thread Jens Axboe
On Tue, Jun 05 2007, Evgeniy Polyakov wrote: > On Tue, Jun 05, 2007 at 10:05:43AM +0200, Jens Axboe ([EMAIL PROTECTED]) > wrote: > > Here's an implementation of tcp network splice receive support. It's > > originally based on the patch set that Intel posted some time ago, but > > has been (close t

Re: [PATCH][RFC] network splice receive

2007-06-06 Thread Jens Axboe
On Tue, Jun 05 2007, jamal wrote: > On Tue, 2007-05-06 at 14:20 +0200, Jens Axboe wrote: > > > > > > > 1800 4ff3 937f e000 6381 7275 0008 > > > > > > Perhaps that hex pattern rings a bell with someone intimate with the > > > networking. The remaining wrong bytes don't seem to have anything

Re: [PATCH][RFC] network splice receive

2007-06-05 Thread Evgeniy Polyakov
On Tue, Jun 05, 2007 at 06:31:31PM +0400, Evgeniy Polyakov ([EMAIL PROTECTED]) wrote: > [ 263.936418] RIP [] skb_splice_bits+0xac/0x1c9 > [ 263.942516] RSP > > This a vm_bug_on in get_page(). > > > +static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page > > *page, >

Re: [PATCH][RFC] network splice receive

2007-06-05 Thread Evgeniy Polyakov
On Tue, Jun 05, 2007 at 10:05:43AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > Here's an implementation of tcp network splice receive support. It's > originally based on the patch set that Intel posted some time ago, but > has been (close to) 100% reworked. > > Now, I'm not a networking guru by

Re: [PATCH][RFC] network splice receive

2007-06-05 Thread Evgeniy Polyakov
On Tue, Jun 05, 2007 at 10:05:43AM +0200, Jens Axboe ([EMAIL PROTECTED]) wrote: > Hi, Hi Jens. > Here's an implementation of tcp network splice receive support. It's > originally based on the patch set that Intel posted some time ago, but > has been (close to) 100% reworked. > > Now, I'm not a n

Re: [PATCH][RFC] network splice receive

2007-06-05 Thread jamal
On Tue, 2007-05-06 at 14:20 +0200, Jens Axboe wrote: > > > > 1800 4ff3 937f e000 6381 7275 0008 > > > > Perhaps that hex pattern rings a bell with someone intimate with the > > networking. The remaining wrong bytes don't seem to have anything in > > common. > > Ok, the source mac address i

Re: [PATCH][RFC] network splice receive

2007-06-05 Thread Jens Axboe
On Tue, Jun 05 2007, Jens Axboe wrote: > On Tue, Jun 05 2007, Jens Axboe wrote: > > Seems to work reasonably well for me, sometimes I do see small ranges > > inside the output file that are not correct, but I haven't been able to > > reproduce today. I think it has to do with page reuse, hence the

Re: [PATCH][RFC] network splice receive

2007-06-05 Thread Jens Axboe
On Tue, Jun 05 2007, Jens Axboe wrote: > Seems to work reasonably well for me, sometimes I do see small ranges > inside the output file that are not correct, but I haven't been able to > reproduce today. I think it has to do with page reuse, hence the > NET_COPY_SPLICE ifdef that you can enable to

[PATCH][RFC] network splice receive

2007-06-05 Thread Jens Axboe
Hi, Here's an implementation of tcp network splice receive support. It's originally based on the patch set that Intel posted some time ago, but has been (close to) 100% reworked. Now, I'm not a networking guru by any stretch of the imagination, so I'd like some input on the direction of the main