search for: vhost_has_work

Displaying 20 results from an estimated 127 matches for "vhost_has_work".

2015 Oct 22
4
[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()
...insertions(+) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index eec2f11..d42d11e 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -245,6 +245,12 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) } EXPORT_SYMBOL_GPL(vhost_work_queue); +bool vhost_has_work(struct vhost_dev *dev) +{ + return !list_empty(&dev->work_list); +} +EXPORT_SYMBOL_GPL(vhost_has_work); + void vhost_poll_queue(struct vhost_poll *poll) { vhost_work_queue(poll->dev, &poll->work); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 4772862..ea0327d...
2015 Oct 22
4
[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()
...insertions(+) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index eec2f11..d42d11e 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -245,6 +245,12 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) } EXPORT_SYMBOL_GPL(vhost_work_queue); +bool vhost_has_work(struct vhost_dev *dev) +{ + return !list_empty(&dev->work_list); +} +EXPORT_SYMBOL_GPL(vhost_has_work); + void vhost_poll_queue(struct vhost_poll *poll) { vhost_work_queue(poll->dev, &poll->work); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 4772862..ea0327d...
2015 Oct 22
0
[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()
...t/vhost.c b/drivers/vhost/vhost.c > index eec2f11..d42d11e 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -245,6 +245,12 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) > } > EXPORT_SYMBOL_GPL(vhost_work_queue); > > +bool vhost_has_work(struct vhost_dev *dev) > +{ > + return !list_empty(&dev->work_list); > +} > +EXPORT_SYMBOL_GPL(vhost_has_work); > + > void vhost_poll_queue(struct vhost_poll *poll) > { > vhost_work_queue(poll->dev, &poll->work); This doesn't take a lock so it'...
2018 Jul 02
2
[PATCH vhost] vhost_net: Fix too many vring kick on busypoll
...ael S. Tsirkin wrote: > On Fri, Jun 29, 2018 at 05:09:50PM +0900, Toshiaki Makita wrote: >> Under heavy load vhost busypoll may run without suppressing >> notification. For example tx zerocopy callback can push tx work while >> handle_tx() is running, then busyloop exits due to vhost_has_work() >> condition and enables notification but immediately reenters handle_tx() >> because the pushed work was tx. In this case handle_tx() tries to >> disable notification again, but when using event_idx it by design >> cannot. Then busyloop will run without suppressing notifi...
2018 Jul 02
2
[PATCH vhost] vhost_net: Fix too many vring kick on busypoll
...ael S. Tsirkin wrote: > On Fri, Jun 29, 2018 at 05:09:50PM +0900, Toshiaki Makita wrote: >> Under heavy load vhost busypoll may run without suppressing >> notification. For example tx zerocopy callback can push tx work while >> handle_tx() is running, then busyloop exits due to vhost_has_work() >> condition and enables notification but immediately reenters handle_tx() >> because the pushed work was tx. In this case handle_tx() tries to >> disable notification again, but when using event_idx it by design >> cannot. Then busyloop will run without suppressing notifi...
2023 Mar 28
1
[PATCH v6 02/11] vhost, vhost-net: add helper to check if vq has work
...ers/vhost/net.c b/drivers/vhost/net.c index 07181cd8d52e..8ed63651b9eb 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -546,7 +546,7 @@ static void vhost_net_busy_poll(struct vhost_net *net, endtime = busy_clock() + busyloop_timeout; while (vhost_can_busy_poll(endtime)) { - if (vhost_has_work(&net->dev)) { + if (vhost_vq_has_work(vq)) { *busyloop_intr = true; break; } diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e041e116afee..6567aed69ebb 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -262,11 +262,11 @@ void vhost_work_queue(stru...
2018 Aug 03
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...>>> Looks like in the last "else" block in vhost_net_busy_poll_check() we >>>>> need to enable vq since in that case we have no rx data and handle_rx() >>>>> is not scheduled. >>>>> >>>> Yes. >>> So we will use the vhost_has_work() to check whether or not the >>> handle_rx is scheduled ? >>> If we use the vhost_has_work(), the work in the dev work_list may be >>> rx work, or tx work, right ? >> >> Yes. We can add a boolean to record whether or not we've called >> vhost_poll_q...
2018 Aug 03
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...>>> Looks like in the last "else" block in vhost_net_busy_poll_check() we >>>>> need to enable vq since in that case we have no rx data and handle_rx() >>>>> is not scheduled. >>>>> >>>> Yes. >>> So we will use the vhost_has_work() to check whether or not the >>> handle_rx is scheduled ? >>> If we use the vhost_has_work(), the work in the dev work_list may be >>> rx work, or tx work, right ? >> >> Yes. We can add a boolean to record whether or not we've called >> vhost_poll_q...
2018 Jul 03
0
[PATCH v2 net-next 2/4] vhost_net: Avoid tx vring kicks during busyloop
Under heavy load vhost busypoll may run without suppressing notification. For example tx zerocopy callback can push tx work while handle_tx() is running, then busyloop exits due to vhost_has_work() condition and enables notification but immediately reenters handle_tx() because the pushed work was tx. In this case handle_tx() tries to disable notification again, but when using event_idx it by design cannot. Then busyloop will run without suppressing notification. Another example is the case...
2018 Jul 03
11
[PATCH v2 net-next 0/4] vhost_net: Avoid vq kicks during busyloop
Under heavy load vhost tx busypoll tend not to suppress vq kicks, which causes poor guest tx performance. The detailed scenario is described in commitlog of patch 2. Rx seems not to have that serious problem, but for consistency I made a similar change on rx to avoid rx wakeups (patch 3). Additionary patch 4 is to avoid rx kicks under heavy load during busypoll. Tx performance is greatly improved
2018 Aug 03
3
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...since handle_rx() will do this for us. >>> Looks like in the last "else" block in vhost_net_busy_poll_check() we >>> need to enable vq since in that case we have no rx data and handle_rx() >>> is not scheduled. >>> >> Yes. > So we will use the vhost_has_work() to check whether or not the > handle_rx is scheduled ? > If we use the vhost_has_work(), the work in the dev work_list may be > rx work, or tx work, right ? Yes. We can add a boolean to record whether or not we've called vhost_poll_queue() for rvq. And avoid calling vhost_net_enabl...
2018 Aug 03
3
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...since handle_rx() will do this for us. >>> Looks like in the last "else" block in vhost_net_busy_poll_check() we >>> need to enable vq since in that case we have no rx data and handle_rx() >>> is not scheduled. >>> >> Yes. > So we will use the vhost_has_work() to check whether or not the > handle_rx is scheduled ? > If we use the vhost_has_work(), the work in the dev work_list may be > rx work, or tx work, right ? Yes. We can add a boolean to record whether or not we've called vhost_poll_queue() for rvq. And avoid calling vhost_net_enabl...
2018 Jun 29
5
[PATCH vhost] vhost_net: Fix too many vring kick on busypoll
Under heavy load vhost busypoll may run without suppressing notification. For example tx zerocopy callback can push tx work while handle_tx() is running, then busyloop exits due to vhost_has_work() condition and enables notification but immediately reenters handle_tx() because the pushed work was tx. In this case handle_tx() tries to disable notification again, but when using event_idx it by design cannot. Then busyloop will run without suppressing notification. Another example is the case...
2018 Jun 29
5
[PATCH vhost] vhost_net: Fix too many vring kick on busypoll
Under heavy load vhost busypoll may run without suppressing notification. For example tx zerocopy callback can push tx work while handle_tx() is running, then busyloop exits due to vhost_has_work() condition and enables notification but immediately reenters handle_tx() because the pushed work was tx. In this case handle_tx() tries to disable notification again, but when using event_idx it by design cannot. Then busyloop will run without suppressing notification. Another example is the case...
2020 Jun 01
0
[PATCH net-next v8 7/7] net: vhost: make busyloop_intr more accurate
...08:47:35AM +0800, Jason Wang wrote: > > > On 2018?08?21? 08:33, Jason Wang wrote: > > > > > > On 2018?08?19? 20:11, xiangxia.m.yue at gmail.com wrote: > > > From: Tonghao Zhang <xiangxia.m.yue at gmail.com> > > > > > > The patch uses vhost_has_work_pending() to check if > > > the specified handler is scheduled, because in the most case, > > > vhost_has_work() return true when other side handler is added > > > to worker list. Use the vhost_has_work_pending() insead of > > > vhost_has_work(). > > >...
2018 Aug 03
0
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...n the last "else" block in vhost_net_busy_poll_check() we > >>>>> need to enable vq since in that case we have no rx data and handle_rx() > >>>>> is not scheduled. > >>>>> > >>>> Yes. > >>> So we will use the vhost_has_work() to check whether or not the > >>> handle_rx is scheduled ? > >>> If we use the vhost_has_work(), the work in the dev work_list may be > >>> rx work, or tx work, right ? > >> > >> Yes. We can add a boolean to record whether or not we've cal...
2015 Nov 12
5
[PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net
...anges from V2: - poll also at the end of rx handling - factor out the polling logic and optimize the code a little bit - add two ioctls to get and set the busy poll timeout - test on ixgbe (which can give more stable and reproducable numbers) instead of mlx4. Changes from V1: - Add a comment for vhost_has_work() to explain why it could be lockless - Add param description for busyloop_timeout - Split out the busy polling logic into a new helper - Check and exit the loop when there's a pending signal - Disable preemption during busy looping to make sure lock_clock() was correctly used. Jason Wang...
2015 Nov 12
5
[PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net
...anges from V2: - poll also at the end of rx handling - factor out the polling logic and optimize the code a little bit - add two ioctls to get and set the busy poll timeout - test on ixgbe (which can give more stable and reproducable numbers) instead of mlx4. Changes from V1: - Add a comment for vhost_has_work() to explain why it could be lockless - Add param description for busyloop_timeout - Split out the busy polling logic into a new helper - Check and exit the loop when there's a pending signal - Disable preemption during busy looping to make sure lock_clock() was correctly used. Jason Wang...
2016 Mar 04
6
[PATCH V4 0/3] basic busy polling support for vhost_net
...from RFC V2: - poll also at the end of rx handling - factor out the polling logic and optimize the code a little bit - add two ioctls to get and set the busy poll timeout - test on ixgbe (which can give more stable and reproducable numbers) instead of mlx4. Changes from RFC V1: - add a comment for vhost_has_work() to explain why it could be lockless - add param description for busyloop_timeout - split out the busy polling logic into a new helper - check and exit the loop when there's a pending signal - disable preemption during busy looping to make sure lock_clock() was correctly used. Jason Wang (3):...
2016 Mar 04
6
[PATCH V4 0/3] basic busy polling support for vhost_net
...from RFC V2: - poll also at the end of rx handling - factor out the polling logic and optimize the code a little bit - add two ioctls to get and set the busy poll timeout - test on ixgbe (which can give more stable and reproducable numbers) instead of mlx4. Changes from RFC V1: - add a comment for vhost_has_work() to explain why it could be lockless - add param description for busyloop_timeout - split out the busy polling logic into a new helper - check and exit the loop when there's a pending signal - disable preemption during busy looping to make sure lock_clock() was correctly used. Jason Wang (3):...