1. 23 6月, 2014 1 次提交
  2. 09 6月, 2014 3 次提交
    • M
      vhost: move memory pointer to VQs · 47283bef
      Michael S. Tsirkin 提交于
      commit 2ae76693b8bcabf370b981cd00c36cd41d33fabc
          vhost: replace rcu with mutex
      replaced rcu sync for memory accesses with VQ mutex locl/unlock.
      This is correct since all accesses are under VQ mutex, but incomplete:
      we still do useless rcu lock/unlock operations, someone might copy this
      code into some other context where this won't be right.
      This use of RCU is also non standard and hard to understand.
      Let's copy the pointer to each VQ structure, this way
      the access rules become straight-forward, and there's
      no need for RCU anymore.
      Reported-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      47283bef
    • M
      vhost: move acked_features to VQs · ea16c514
      Michael S. Tsirkin 提交于
      Refactor code to make sure features are only accessed
      under VQ mutex. This makes everything simpler, no need
      for RCU here anymore.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ea16c514
    • M
      vhost-net: extend device allocation to vmalloc · 23cc5a99
      Michael S. Tsirkin 提交于
      Michael Mueller provided a patch to reduce the size of
      vhost-net structure as some allocations could fail under
      memory pressure/fragmentation. We are still left with
      high order allocations though.
      
      This patch is handling the problem at the core level, allowing
      vhost structures to use vmalloc() if kmalloc() failed.
      
      As vmalloc() adds overhead on a critical network path, add __GFP_REPEAT
      to kzalloc() flags to do this fallback only when really needed.
      
      People are still looking at cleaner ways to handle the problem
      at the API level, probably passing in multiple iovecs.
      This hack seems consistent with approaches
      taken since then by drivers/vhost/scsi.c and net/core/dev.c
      
      Based on patch by Romain Francoise.
      
      Cc: Michael Mueller <mimu@linux.vnet.ibm.com>
      Signed-off-by: NRomain Francoise <romain@orebokech.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      23cc5a99
  3. 02 4月, 2014 1 次提交
  4. 29 3月, 2014 2 次提交
  5. 14 2月, 2014 2 次提交
  6. 07 12月, 2013 1 次提交
  7. 04 9月, 2013 5 次提交
  8. 11 7月, 2013 2 次提交
  9. 10 7月, 2013 1 次提交
  10. 07 7月, 2013 2 次提交
  11. 11 6月, 2013 3 次提交
    • M
      vhost: fix ubuf_info cleanup · 288cfe78
      Michael S. Tsirkin 提交于
      vhost_net_clear_ubuf_info didn't clear ubuf_info
      after kfree, this could trigger double free.
      Fix this and simplify this code to make it more robust: make sure
      ubuf info is always freed through vhost_net_clear_ubuf_info.
      Reported-by: NTommi Rantala <tt.rantala@gmail.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      288cfe78
    • M
      vhost: check owner before we overwrite ubuf_info · 05c05351
      Michael S. Tsirkin 提交于
      If device has an owner, we shouldn't touch ubuf_info
      since it might be in use.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05c05351
    • J
      vhost_net: clear msg.control for non-zerocopy case during tx · 4364d5f9
      Jason Wang 提交于
      When we decide not use zero-copy, msg.control should be set to NULL otherwise
      macvtap/tap may set zerocopy callbacks which may decrease the kref of ubufs
      wrongly.
      
      Bug were introduced by commit cedb9bdc
      (vhost-net: skip head management if no outstanding).
      
      This solves the following warnings:
      
      WARNING: at include/linux/kref.h:47 handle_tx+0x477/0x4b0 [vhost_net]()
      Modules linked in: vhost_net macvtap macvlan tun nfsd exportfs bridge stp llc openvswitch kvm_amd kvm bnx2 megaraid_sas [last unloaded: tun]
      CPU: 5 PID: 8670 Comm: vhost-8668 Not tainted 3.10.0-rc2+ #1566
      Hardware name: Dell Inc. PowerEdge R715/00XHKG, BIOS 1.5.2 04/19/2011
      ffffffffa0198323 ffff88007c9ebd08 ffffffff81796b73 ffff88007c9ebd48
      ffffffff8103d66b 000000007b773e20 ffff8800779f0000 ffff8800779f43f0
      ffff8800779f8418 000000000000015c 0000000000000062 ffff88007c9ebd58
      Call Trace:
      [<ffffffff81796b73>] dump_stack+0x19/0x1e
      [<ffffffff8103d66b>] warn_slowpath_common+0x6b/0xa0
      [<ffffffff8103d6b5>] warn_slowpath_null+0x15/0x20
      [<ffffffffa0197627>] handle_tx+0x477/0x4b0 [vhost_net]
      [<ffffffffa0197690>] handle_tx_kick+0x10/0x20 [vhost_net]
      [<ffffffffa019541e>] vhost_worker+0xfe/0x1a0 [vhost_net]
      [<ffffffffa0195320>] ? vhost_attach_cgroups_work+0x30/0x30 [vhost_net]
      [<ffffffffa0195320>] ? vhost_attach_cgroups_work+0x30/0x30 [vhost_net]
      [<ffffffff81061f46>] kthread+0xc6/0xd0
      [<ffffffff81061e80>] ? kthread_freezable_should_stop+0x70/0x70
      [<ffffffff817a1aec>] ret_from_fork+0x7c/0xb0
      [<ffffffff81061e80>] ? kthread_freezable_should_stop+0x70/0x70
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4364d5f9
  12. 06 5月, 2013 3 次提交
  13. 01 5月, 2013 4 次提交
  14. 12 4月, 2013 1 次提交
    • J
      vhost_net: remove tx polling state · 70181d51
      Jason Wang 提交于
      After commit 2b8b328b (vhost_net: handle polling
      errors when setting backend), we in fact track the polling state through
      poll->wqh, so there's no need to duplicate the work with an extra
      vhost_net_polling_state. So this patch removes this and make the code simpler.
      
      This patch also removes the all tx starting/stopping code in tx path according
      to Michael's suggestion.
      
      Netperf test shows almost the same result in stream test, but gets improvements
      on TCP_RR tests (both zerocopy or copy) especially on low load cases.
      
      Tested between multiqueue kvm guest and external host with two direct
      connected 82599s.
      
      zerocopy disabled:
      
      sessions|transaction rates|normalize|
      before/after/+improvements
      1 | 9510.24/11727.29/+23.3%    | 693.54/887.68/+28.0%   |
      25| 192931.50/241729.87/+25.3% | 2376.80/2771.70/+16.6% |
      50| 277634.64/291905.76/+5%    | 3118.36/3230.11/+3.6%  |
      
      zerocopy enabled:
      
      sessions|transaction rates|normalize|
      before/after/+improvements
      1 | 7318.33/11929.76/+63.0%    | 521.86/843.30/+61.6%   |
      25| 167264.88/242422.15/+44.9% | 2181.60/2788.16/+27.8% |
      50| 272181.02/294347.04/+8.1%  | 3071.56/3257.85/+6.1%  |
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      70181d51
  15. 18 3月, 2013 1 次提交
  16. 30 1月, 2013 2 次提交
  17. 06 12月, 2012 4 次提交
  18. 04 12月, 2012 1 次提交
  19. 03 11月, 2012 1 次提交