Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-29 Thread Rusty Russell
On Sat, 28 May 2011 23:02:04 +0300, "Michael S. Tsirkin" wrote: > On Thu, May 26, 2011 at 12:58:23PM +0930, Rusty Russell wrote: > > ie. free two packets for every one we're about to add. For steady state > > that would work really well. > > Sure, with indirect buffers, but if we > don't use in

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-28 Thread Michael S. Tsirkin
On Thu, May 26, 2011 at 12:58:23PM +0930, Rusty Russell wrote: > On Wed, 25 May 2011 09:07:59 +0300, "Michael S. Tsirkin" > wrote: > > On Wed, May 25, 2011 at 11:05:04AM +0930, Rusty Russell wrote: > > Hmm I'm not sure I got it, need to think about this. > > I'd like to go back and document how m

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-27 Thread Rusty Russell
On Wed, 25 May 2011 09:07:59 +0300, "Michael S. Tsirkin" wrote: > On Wed, May 25, 2011 at 11:05:04AM +0930, Rusty Russell wrote: > Hmm I'm not sure I got it, need to think about this. > I'd like to go back and document how my design was supposed to work. > This really should have been in commit l

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Michael S. Tsirkin
On Wed, May 25, 2011 at 11:05:04AM +0930, Rusty Russell wrote: > On Mon, 23 May 2011 14:19:00 +0300, "Michael S. Tsirkin" > wrote: > > I do understand how it seems a waste to leave direct space > > in the ring while we might in practice have space > > due to indirect. Didn't come up with a nice w

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Michael S. Tsirkin
On Wed, May 25, 2011 at 10:58:26AM +0930, Rusty Russell wrote: > On Mon, 23 May 2011 14:19:00 +0300, "Michael S. Tsirkin" > wrote: > > On Mon, May 23, 2011 at 11:37:15AM +0930, Rusty Russell wrote: > > > Can we hit problems with OOM? Sure, but no worse than now... > > > The problem is that this

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Rusty Russell
On Mon, 23 May 2011 14:19:00 +0300, "Michael S. Tsirkin" wrote: > I do understand how it seems a waste to leave direct space > in the ring while we might in practice have space > due to indirect. Didn't come up with a nice way to > solve this yet - but 'no worse than now :)' Let's just make it "

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Rusty Russell
On Mon, 23 May 2011 14:19:00 +0300, "Michael S. Tsirkin" wrote: > On Mon, May 23, 2011 at 11:37:15AM +0930, Rusty Russell wrote: > > Can we hit problems with OOM? Sure, but no worse than now... > > The problem is that this "virtqueue_get_capacity()" returns the worst > > case, not the normal cas

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Michael S. Tsirkin
On Tue, May 24, 2011 at 06:20:35PM +0530, Krishna Kumar2 wrote: > "Michael S. Tsirkin" wrote on 05/24/2011 04:59:39 PM: > > > > > > Maybe Rusty means it is a simpler model to free the amount > > > > > of space that this xmit needs. We will still fail anyway > > > > > at some time but it is unlike

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Krishna Kumar2
"Michael S. Tsirkin" wrote on 05/24/2011 04:59:39 PM: > > > > Maybe Rusty means it is a simpler model to free the amount > > > > of space that this xmit needs. We will still fail anyway > > > > at some time but it is unlikely, since earlier iteration > > > > freed up atleast the space that it was

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Michael S. Tsirkin
On Tue, May 24, 2011 at 02:57:43PM +0530, Krishna Kumar2 wrote: > "Michael S. Tsirkin" wrote on 05/24/2011 02:42:55 PM: > > > > > > To do this properly, we should really be using the actual number of > sg > > > > > elements needed, but we'd have to do most of xmit_skb beforehand so > we > > > > >

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Krishna Kumar2
"Michael S. Tsirkin" wrote on 05/24/2011 02:42:55 PM: > > > > To do this properly, we should really be using the actual number of sg > > > > elements needed, but we'd have to do most of xmit_skb beforehand so we > > > > know how many. > > > > > > > > Cheers, > > > > Rusty. > > > > > > Maybe I'm c

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Michael S. Tsirkin
On Tue, May 24, 2011 at 01:24:15PM +0530, Krishna Kumar2 wrote: > "Michael S. Tsirkin" wrote on 05/23/2011 04:49:00 PM: > > > > To do this properly, we should really be using the actual number of sg > > > elements needed, but we'd have to do most of xmit_skb beforehand so we > > > know how many.

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-24 Thread Krishna Kumar2
"Michael S. Tsirkin" wrote on 05/23/2011 04:49:00 PM: > > To do this properly, we should really be using the actual number of sg > > elements needed, but we'd have to do most of xmit_skb beforehand so we > > know how many. > > > > Cheers, > > Rusty. > > Maybe I'm confused here. The problem isn't

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-23 Thread Michael S. Tsirkin
On Mon, May 23, 2011 at 11:37:15AM +0930, Rusty Russell wrote: > On Sun, 22 May 2011 15:10:08 +0300, "Michael S. Tsirkin" > wrote: > > On Sat, May 21, 2011 at 11:49:59AM +0930, Rusty Russell wrote: > > > On Fri, 20 May 2011 02:11:56 +0300, "Michael S. Tsirkin" > > > wrote: > > > > Current code

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-22 Thread Rusty Russell
On Sun, 22 May 2011 15:10:08 +0300, "Michael S. Tsirkin" wrote: > On Sat, May 21, 2011 at 11:49:59AM +0930, Rusty Russell wrote: > > On Fri, 20 May 2011 02:11:56 +0300, "Michael S. Tsirkin" > > wrote: > > > Current code might introduce a lot of latency variation > > > if there are many pending

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-22 Thread Michael S. Tsirkin
On Sat, May 21, 2011 at 11:49:59AM +0930, Rusty Russell wrote: > On Fri, 20 May 2011 02:11:56 +0300, "Michael S. Tsirkin" > wrote: > > Current code might introduce a lot of latency variation > > if there are many pending bufs at the time we > > attempt to transmit a new one. This is bad for > > r

Re: [PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-20 Thread Rusty Russell
On Fri, 20 May 2011 02:11:56 +0300, "Michael S. Tsirkin" wrote: > Current code might introduce a lot of latency variation > if there are many pending bufs at the time we > attempt to transmit a new one. This is bad for > real-time applications and can't be good for TCP either. Do we have more th

[PATCHv2 10/14] virtio_net: limit xmit polling

2011-05-19 Thread Michael S. Tsirkin
Current code might introduce a lot of latency variation if there are many pending bufs at the time we attempt to transmit a new one. This is bad for real-time applications and can't be good for TCP either. Free up just enough to both clean up all buffers eventually and to be able to xmit the next