* [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call
@ 2010-06-03 19:38 Bruce Rogers
2010-06-03 21:03 ` [stable] " Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Bruce Rogers @ 2010-06-03 19:38 UTC (permalink / raw)
To: avi; +Cc: stable, kvm
virtio_net: Add schedule check to napi_enable call
Under harsh testing conditions, including low memory, the guest would
stop receiving packets. With this patch applied we no longer see any
problems in the driver while performing these tests for extended periods
of time.
Make sure napi is scheduled subsequent to each napi_enable.
Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Olaf Kirch <okir@suse.de>
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -388,6 +388,20 @@ static void skb_recv_done(struct virtque
}
}
+static void virtnet_napi_enable(struct virtnet_info *vi)
+{
+ napi_enable(&vi->napi);
+
+ /* If all buffers were filled by other side before we napi_enabled, we
+ * won't get another interrupt, so process any outstanding packets
+ * now. virtnet_poll wants re-enable the queue, so we disable here.
+ * We synchronize against interrupts via NAPI_STATE_SCHED */
+ if (napi_schedule_prep(&vi->napi)) {
+ vi->rvq->vq_ops->disable_cb(vi->rvq);
+ __napi_schedule(&vi->napi);
+ }
+}
+
static void refill_work(struct work_struct *work)
{
struct virtnet_info *vi;
@@ -397,7 +411,7 @@ static void refill_work(struct work_stru
napi_disable(&vi->napi);
try_fill_recv(vi, GFP_KERNEL);
still_empty = (vi->num == 0);
- napi_enable(&vi->napi);
+ virtnet_napi_enable(vi);
/* In theory, this can happen: if we don't get any buffers in
* we will *never* try to fill again. */
@@ -589,16 +603,7 @@ static int virtnet_open(struct net_devic
{
struct virtnet_info *vi = netdev_priv(dev);
- napi_enable(&vi->napi);
-
- /* If all buffers were filled by other side before we napi_enabled, we
- * won't get another interrupt, so process any outstanding packets
- * now. virtnet_poll wants re-enable the queue, so we disable here.
- * We synchronize against interrupts via NAPI_STATE_SCHED */
- if (napi_schedule_prep(&vi->napi)) {
- vi->rvq->vq_ops->disable_cb(vi->rvq);
- __napi_schedule(&vi->napi);
- }
+ virtnet_napi_enable(vi);
return 0;
}
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [stable] [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call
2010-06-03 19:38 [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call Bruce Rogers
@ 2010-06-03 21:03 ` Greg KH
2010-06-03 22:17 ` Bruce Rogers
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2010-06-03 21:03 UTC (permalink / raw)
To: Bruce Rogers; +Cc: avi, stable, kvm
On Thu, Jun 03, 2010 at 01:38:31PM -0600, Bruce Rogers wrote:
> virtio_net: Add schedule check to napi_enable call
> Under harsh testing conditions, including low memory, the guest would
> stop receiving packets. With this patch applied we no longer see any
> problems in the driver while performing these tests for extended periods
> of time.
>
> Make sure napi is scheduled subsequent to each napi_enable.
>
> Signed-off-by: Bruce Rogers <brogers@novell.com>
> Signed-off-by: Olaf Kirch <okir@suse.de>
I need a git commit id for this one as well.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [stable] [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call
2010-06-03 21:03 ` [stable] " Greg KH
@ 2010-06-03 22:17 ` Bruce Rogers
2010-06-03 22:51 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Bruce Rogers @ 2010-06-03 22:17 UTC (permalink / raw)
To: Greg KH; +Cc: stable, avi, kvm
>>> On 6/3/2010 at 03:03 PM, Greg KH <greg@kroah.com> wrote:
> On Thu, Jun 03, 2010 at 01:38:31PM -0600, Bruce Rogers wrote:
>> virtio_net: Add schedule check to napi_enable call
>> Under harsh testing conditions, including low memory, the guest would
>> stop receiving packets. With this patch applied we no longer see any
>> problems in the driver while performing these tests for extended periods
>> of time.
>>
>> Make sure napi is scheduled subsequent to each napi_enable.
>>
>> Signed-off-by: Bruce Rogers <brogers@novell.com>
>> Signed-off-by: Olaf Kirch <okir@suse.de>
>
> I need a git commit id for this one as well.
>
This one is not upstream.
Bruce
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [stable] [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call
2010-06-03 22:17 ` Bruce Rogers
@ 2010-06-03 22:51 ` Greg KH
2010-06-04 0:02 ` Bruce Rogers
2010-06-04 0:02 ` Bruce Rogers
0 siblings, 2 replies; 8+ messages in thread
From: Greg KH @ 2010-06-03 22:51 UTC (permalink / raw)
To: Bruce Rogers; +Cc: stable, avi, kvm
On Thu, Jun 03, 2010 at 04:17:34PM -0600, Bruce Rogers wrote:
> >>> On 6/3/2010 at 03:03 PM, Greg KH <greg@kroah.com> wrote:
> > On Thu, Jun 03, 2010 at 01:38:31PM -0600, Bruce Rogers wrote:
> >> virtio_net: Add schedule check to napi_enable call
> >> Under harsh testing conditions, including low memory, the guest would
> >> stop receiving packets. With this patch applied we no longer see any
> >> problems in the driver while performing these tests for extended periods
> >> of time.
> >>
> >> Make sure napi is scheduled subsequent to each napi_enable.
> >>
> >> Signed-off-by: Bruce Rogers <brogers@novell.com>
> >> Signed-off-by: Olaf Kirch <okir@suse.de>
> >
> > I need a git commit id for this one as well.
> >
>
> This one is not upstream.
Then I can't include it in the -stable tree, so why are you sending it
to me? :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [stable] [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call
2010-06-03 22:51 ` Greg KH
@ 2010-06-04 0:02 ` Bruce Rogers
2010-06-04 0:02 ` Bruce Rogers
1 sibling, 0 replies; 8+ messages in thread
From: Bruce Rogers @ 2010-06-04 0:02 UTC (permalink / raw)
To: Greg KH; +Cc: stable, avi, kvm
>>> On 6/3/2010 at 04:51 PM, Greg KH <greg@kroah.com> wrote:
> On Thu, Jun 03, 2010 at 04:17:34PM -0600, Bruce Rogers wrote:
>> >>> On 6/3/2010 at 03:03 PM, Greg KH <greg@kroah.com> wrote:
>> > On Thu, Jun 03, 2010 at 01:38:31PM -0600, Bruce Rogers wrote:
>> >> virtio_net: Add schedule check to napi_enable call
>> >> Under harsh testing conditions, including low memory, the guest would
>> >> stop receiving packets. With this patch applied we no longer see any
>> >> problems in the driver while performing these tests for extended
> periods
>> >> of time.
>> >>
>> >> Make sure napi is scheduled subsequent to each napi_enable.
>> >>
>> >> Signed-off-by: Bruce Rogers <brogers@novell.com>
>> >> Signed-off-by: Olaf Kirch <okir@suse.de>
>> >
>> > I need a git commit id for this one as well.
>> >
>>
>> This one is not upstream.
>
> Then I can't include it in the -stable tree, so why are you sending it
> to me? :)
>
> thanks,
>
> greg k-h
Good point!
Sorry about the confusion.
Bruce
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [stable] [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call
2010-06-03 22:51 ` Greg KH
2010-06-04 0:02 ` Bruce Rogers
@ 2010-06-04 0:02 ` Bruce Rogers
2010-12-03 15:44 ` Peter Lieven
1 sibling, 1 reply; 8+ messages in thread
From: Bruce Rogers @ 2010-06-04 0:02 UTC (permalink / raw)
To: Greg KH; +Cc: stable, avi, kvm
>>> On 6/3/2010 at 04:51 PM, Greg KH <greg@kroah.com> wrote:
> On Thu, Jun 03, 2010 at 04:17:34PM -0600, Bruce Rogers wrote:
>> >>> On 6/3/2010 at 03:03 PM, Greg KH <greg@kroah.com> wrote:
>> > On Thu, Jun 03, 2010 at 01:38:31PM -0600, Bruce Rogers wrote:
>> >> virtio_net: Add schedule check to napi_enable call
>> >> Under harsh testing conditions, including low memory, the guest would
>> >> stop receiving packets. With this patch applied we no longer see any
>> >> problems in the driver while performing these tests for extended
> periods
>> >> of time.
>> >>
>> >> Make sure napi is scheduled subsequent to each napi_enable.
>> >>
>> >> Signed-off-by: Bruce Rogers <brogers@novell.com>
>> >> Signed-off-by: Olaf Kirch <okir@suse.de>
>> >
>> > I need a git commit id for this one as well.
>> >
>>
>> This one is not upstream.
>
> Then I can't include it in the -stable tree, so why are you sending it
> to me? :)
>
> thanks,
>
> greg k-h
Good point!
Sorry about the confusion.
Bruce
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [stable] [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call
2010-06-04 0:02 ` Bruce Rogers
@ 2010-12-03 15:44 ` Peter Lieven
2010-12-06 16:12 ` Avi Kivity
0 siblings, 1 reply; 8+ messages in thread
From: Peter Lieven @ 2010-12-03 15:44 UTC (permalink / raw)
To: Bruce Rogers; +Cc: Avi Kivity, kvm
Am 04.06.2010 um 02:02 schrieb Bruce Rogers:
>>>> On 6/3/2010 at 04:51 PM, Greg KH <greg@kroah.com> wrote:
>> On Thu, Jun 03, 2010 at 04:17:34PM -0600, Bruce Rogers wrote:
>>>>>> On 6/3/2010 at 03:03 PM, Greg KH <greg@kroah.com> wrote:
>>>> On Thu, Jun 03, 2010 at 01:38:31PM -0600, Bruce Rogers wrote:
>>>>> virtio_net: Add schedule check to napi_enable call
>>>>> Under harsh testing conditions, including low memory, the guest would
>>>>> stop receiving packets. With this patch applied we no longer see any
>>>>> problems in the driver while performing these tests for extended
>> periods
>>>>> of time.
>>>>>
>>>>> Make sure napi is scheduled subsequent to each napi_enable.
>>>>>
>>>>> Signed-off-by: Bruce Rogers <brogers@novell.com>
>>>>> Signed-off-by: Olaf Kirch <okir@suse.de>
>>>>
>>>> I need a git commit id for this one as well.
>>>>
>>>
>>> This one is not upstream.
>>
>> Then I can't include it in the -stable tree, so why are you sending it
>> to me? :)
>>
>> thanks,
>>
>> greg k-h
>
> Good point!
> Sorry about the confusion.
> Bruce
Is there any reason why this patch is not yet in the stable kernel?
virtio_net is still crashing under heavy load in current vanilla kernel.
This patch *might be* the solution.
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [stable] [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call
2010-12-03 15:44 ` Peter Lieven
@ 2010-12-06 16:12 ` Avi Kivity
0 siblings, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2010-12-06 16:12 UTC (permalink / raw)
To: Peter Lieven; +Cc: Bruce Rogers, kvm
On 12/03/2010 05:44 PM, Peter Lieven wrote:
> Is there any reason why this patch is not yet in the stable kernel?
> virtio_net is still crashing under heavy load in current vanilla kernel.
> This patch *might be* the solution.
Perhaps some confusion. I've asked Greg to take kvm patches from
Marcelo and myself (after they've been autotested), however virtio is
not kvm, so the normal stable@ free-for-all applies.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-12-06 16:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-03 19:38 [PATCH 3/3][STABLE] KVM: add schedule check to napi_enable call Bruce Rogers
2010-06-03 21:03 ` [stable] " Greg KH
2010-06-03 22:17 ` Bruce Rogers
2010-06-03 22:51 ` Greg KH
2010-06-04 0:02 ` Bruce Rogers
2010-06-04 0:02 ` Bruce Rogers
2010-12-03 15:44 ` Peter Lieven
2010-12-06 16:12 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox