Re: [PATCH v4 04/25] virtio: defer config changed notifications

2014-10-14 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Defer config changed notifications that arrive during probe/scan/freeze/restore. This will allow drivers to set DRIVER_OK earlier, without worrying about racing with config change interrupts. This change will also benefit old hypervisors (before

Re: [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()

2014-10-14 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, Sep 05, 2014 at 12:40:50PM +0200, Paolo Bonzini wrote: Il 03/09/2014 06:29, Rusty Russell ha scritto: + sg_init_table(rq-sg, MAX_SKB_FRAGS + 2); I think 2 is enough here. That said... sg_set_buf(rq-sg, hdr-hdr, sizeof hdr-hdr); -

Re: [PATCH 2/2] virtio_balloon: free some memory from baloon on OOM

2014-10-14 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, Oct 13, 2014 at 04:02:52PM +1030, Rusty Russell wrote: Denis V. Lunev d...@parallels.com writes: From: Raushaniya Maksudova rmaksud...@parallels.com Excessive virtio_balloon inflation can cause invocation of OOM-killer, when Linux is

Re: [PATCH v4 04/25] virtio: defer config changed notifications

2014-10-14 Thread Michael S. Tsirkin
On Tue, Oct 14, 2014 at 11:01:12AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: Defer config changed notifications that arrive during probe/scan/freeze/restore. This will allow drivers to set DRIVER_OK earlier, without worrying about racing with config change

Re: [PATCH 2/2] virtio_balloon: free some memory from baloon on OOM

2014-10-14 Thread Michael S. Tsirkin
On Tue, Oct 14, 2014 at 10:14:05AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Mon, Oct 13, 2014 at 04:02:52PM +1030, Rusty Russell wrote: Denis V. Lunev d...@parallels.com writes: From: Raushaniya Maksudova rmaksud...@parallels.com Excessive

Re: [PATCH net-next RFC 0/3] virtio-net: Conditionally enable tx interrupt

2014-10-14 Thread David Miller
From: Jason Wang jasow...@redhat.com Date: Sat, 11 Oct 2014 15:16:43 +0800 We free old transmitted packets in ndo_start_xmit() currently, so any packet must be orphaned also there. This was used to reduce the overhead of tx interrupt to achieve better performance. But this may not work for

Re: [PATCH net-next RFC 0/3] virtio-net: Conditionally enable tx interrupt

2014-10-14 Thread Michael S. Tsirkin
On Tue, Oct 14, 2014 at 02:53:27PM -0400, David Miller wrote: From: Jason Wang jasow...@redhat.com Date: Sat, 11 Oct 2014 15:16:43 +0800 We free old transmitted packets in ndo_start_xmit() currently, so any packet must be orphaned also there. This was used to reduce the overhead of tx

Re: [PATCH net-next RFC 3/3] virtio-net: conditionally enable tx interrupt

2014-10-14 Thread Michael S. Tsirkin
On Sat, Oct 11, 2014 at 03:16:46PM +0800, Jason Wang wrote: We free transmitted packets in ndo_start_xmit() in the past to get better performance in the past. One side effect is that skb_orphan() needs to be called in ndo_start_xmit() which makes sk_wmem_alloc not accurate in fact. For TCP

[PATCH RFC] virtio_net: enable tx interrupt

2014-10-14 Thread Michael S. Tsirkin
On newer hosts that support delayed tx interrupts, we probably don't have much to gain from orphaning packets early. Based on patch by Jason Wang. Note: this will likely degrade performance for hosts without event idx support. Various fallback options are available, including orphaning

Re: [PATCH net-next RFC 0/3] virtio-net: Conditionally enable tx interrupt

2014-10-14 Thread Michael S. Tsirkin
On Tue, Oct 14, 2014 at 02:53:27PM -0400, David Miller wrote: From: Jason Wang jasow...@redhat.com Date: Sat, 11 Oct 2014 15:16:43 +0800 We free old transmitted packets in ndo_start_xmit() currently, so any packet must be orphaned also there. This was used to reduce the overhead of tx

Re: [PATCH RFC] virtio_net: enable tx interrupt

2014-10-14 Thread Michael S. Tsirkin
On Wed, Oct 15, 2014 at 12:53:59AM +0300, Michael S. Tsirkin wrote: static void skb_xmit_done(struct virtqueue *vq) { struct virtnet_info *vi = vq-vdev-priv; + struct send_queue *sq = vi-sq[vq2txq(vq)]; - /* Suppress further interrupts. */ - virtqueue_disable_cb(vq);

Re: [PATCH net-next RFC 0/3] virtio-net: Conditionally enable tx interrupt

2014-10-14 Thread Jason Wang
On 10/15/2014 05:51 AM, Michael S. Tsirkin wrote: On Tue, Oct 14, 2014 at 02:53:27PM -0400, David Miller wrote: From: Jason Wang jasow...@redhat.com Date: Sat, 11 Oct 2014 15:16:43 +0800 We free old transmitted packets in ndo_start_xmit() currently, so any packet must be orphaned also there.

Re: [PATCH net-next RFC 3/3] virtio-net: conditionally enable tx interrupt

2014-10-14 Thread Jason Wang
On 10/15/2014 05:51 AM, Michael S. Tsirkin wrote: On Sat, Oct 11, 2014 at 03:16:46PM +0800, Jason Wang wrote: We free transmitted packets in ndo_start_xmit() in the past to get better performance in the past. One side effect is that skb_orphan() needs to be called in ndo_start_xmit() which

Re: [PATCH RFC] virtio_net: enable tx interrupt

2014-10-14 Thread Jason Wang
On 10/15/2014 07:11 AM, Michael S. Tsirkin wrote: On Wed, Oct 15, 2014 at 12:53:59AM +0300, Michael S. Tsirkin wrote: static void skb_xmit_done(struct virtqueue *vq) { struct virtnet_info *vi = vq-vdev-priv; + struct send_queue *sq = vi-sq[vq2txq(vq)]; - /* Suppress further

[PATCH 1/2] virtio_balloon: return the amount of freed memory from leak_balloon()

2014-10-14 Thread Denis V. Lunev
From: Raushaniya Maksudova rmaksud...@parallels.com This value would be useful in the next patch to provide the amount of the freed memory for OOM killer. Signed-off-by: Raushaniya Maksudova rmaksud...@parallels.com Signed-off-by: Denis V. Lunev d...@openvz.org CC: Rusty Russell

[PATCH 2/2] virtio_balloon: free some memory from balloon on OOM

2014-10-14 Thread Denis V. Lunev
From: Raushaniya Maksudova rmaksud...@parallels.com Excessive virtio_balloon inflation can cause invocation of OOM-killer, when Linux is under severe memory pressure. Various mechanisms are responsible for correct virtio_balloon memory management. Nevertheless it is often the case that these

Re: [PATCH RFC] virtio_net: enable tx interrupt

2014-10-14 Thread Jason Wang
On 10/15/2014 12:33 PM, Jason Wang wrote: On 10/15/2014 07:11 AM, Michael S. Tsirkin wrote: On Wed, Oct 15, 2014 at 12:53:59AM +0300, Michael S. Tsirkin wrote: static void skb_xmit_done(struct virtqueue *vq) { struct virtnet_info *vi = vq-vdev-priv; + struct send_queue