WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel][PV-ops][PATCH 0/2] VNIF: Using smart polling instead ofe

To: James Harper <james.harper@xxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel][PV-ops][PATCH 0/2] VNIF: Using smart polling instead ofevent notification.
From: "Xu, Dongxiao" <dongxiao.xu@xxxxxxxxx>
Date: Thu, 1 Oct 2009 01:16:44 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "jeremy@xxxxxxxx" <jeremy@xxxxxxxx>
Delivery-date: Wed, 30 Sep 2009 10:18:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AEC6C66638C05B468B556EA548C1A77D0177D643@trantor>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <EADF0A36011179459010BDF5142A457501CEB8B299@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, <AEC6C66638C05B468B556EA548C1A77D0177D643@trantor>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcpBnqh8Tgp1dOzyQlOW4zT0n5YPMwADUdQQABCsxN0=
Thread-topic: [Xen-devel][PV-ops][PATCH 0/2] VNIF: Using smart polling instead ofevent notification.
James, 
    Putting this logic in netfront could almost eliminate all the event 
notification, and from the data we can see that this approach brings more CPU 
utilization downgrade. Also the flag set in xenstore give options to users, and 
they can choose to use it or not. get_coalesce/set_coalesce interfaces give 
user to balance the latency and CPU utilization. 
    The 'bursty' traffic in netback will not affect our optimization. The 
polling in netfront will automatically stop working if there are no data 
packets sent/received during 100ms, which is much longer than the interrupt 
interval. 

Thanks!
Dongxiao

________________________________________
From: James Harper [james.harper@xxxxxxxxxxxxxxxx]
Sent: Wednesday, September 30, 2009 2:17 AM
To: Xu, Dongxiao; xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel][PV-ops][PATCH 0/2] VNIF: Using smart polling instead 
ofevent notification.

>
> One of the VNIF driver's scalability issues is the high event
> channel frequency. It's highly related to physical NIC's interrupt
> frequency in dom0, which could be 20K HZ in some situation. The
> high frequency event channel notification makes the guest and dom0
> CPU utilization at a high value, especially in multi-VM cases.
> The following two patches uses smart polling mechanism to
> replace event notification to reduce the CPU Utilization.
>
> Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
>

I really think that this problem would be better solved in the backend.
In its simplest form, the backend simply needs to know the maximum
acceptable packet latency between putting a packet on the rx ring and
notifying the frontend (in addition to the existing event notification
mechanism).

The algorithm is something like:

Send Packet to frontend:
. put packet on ring
. if prod crosses event then notify as normal
. if event is > prod and there is no outstanding timer set then set the
timer to now + 1ms (or whatever the maximum latency is set to).

On Timer:
. notify the frontend

A more complicated form could also:
. define the maximum amount of 'work' per notify (eg always notify when
there is (eg) 256k of data or more, regardless of timers or other
criteria)
. define a 'max time since last packet' vs 'max time since first packet'
timers, to allow more packets to build up if they are coming in in a
steady stream.

A question though, a lot of hardware adapters already support interrupt
moderation, which would result in 'bursty' traffic in the backend, does
that affect this sort of optimization?

I have some comments on your patches too, I'll follow up in a separate
email.

James
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel