From: "Simon Martin" Subject: Re: VCPUOP_set_periodic_timer Date: Fri, 15 Nov 2013 11:45:14 +0000 Message-ID: References: Reply-To: Simon Martin Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9163810161198750015==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Keir Fraser , Andrew Cooper Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============9163810161198750015== Content-Type: multipart/alternative; boundary="------=_MB3103A119-E60A-48C2-871D-57C7F3D85C0E" --------=_MB3103A119-E60A-48C2-871D-57C7F3D85C0E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; format=flowed; charset=utf-8 Thanks Keir, That sounds quite reasonable. What granularity can I achieve with this?=20 Any idea on the jitter? Regards. ------ Original Message ------ From: "Keir Fraser" To: "Simon Martin" ; "Andrew Cooper"=20 Cc: "xen-devel@lists.xen.org" Sent: 15/11/2013 08:36:45 Subject: Re: [Xen-devel] VCPUOP_set_periodic_timer >The periodic_timer is really a coarse-grained timer for driving a=20 >legacy ticker. It is considered low accuracy and low priority =E2=80=93= for=20 >example, it is stopped entirely while a vcpu is descheduled! > >You should use VCPUOP_set_singleshot_timer, and call it again at the=20 >end of your timer handler to get the desired periodic behaviour. If you= =20 >have multiple timers in your OS you would manage them in your OS and=20 >pick the nearest deadline to program down to Xen. > > -- Keir > >On 15/11/2013 11:24, "Simon Martin" wrote: > >>Hi Andrew, >> >>The operating system I am trying to port to Xen is an industrial servo= =20 >>controller. We are currently running at 125 microsecond servo update=20 >>rate on our bespoke hardware (at the moment MIPS64 and ARM) (hence the= =20 >>125 microsecond ideal interrupt period). We will be driving EtherCAT=20 >>servo drives that need to be updated at 500 microseconds (hence at=20 >>least 500 microsecond interrupt period). If we can achieve this on a=20 >>single core ARM11 clocked at 532 MHz, it must be achievable on PC=20 >>hardware. As I said before the idea is to dedicate a CPU core to this=20 >>with all other functions running on the other cores. >> >>Luckily we can accept a reasonable amount of jitter on the EtherCAT=20 >>network as we can hand over clock synchronisation to a slave. This=20 >>gives us a little leeway. >> >>Regards. >> >> >>------ Original Message ------ >>From: "Andrew Cooper" >>To: "Simon Martin" ; "xen-devel@lists.xen.org"=20 >> >>Sent: 14/11/2013 18:39:21 >>Subject: Re: [Xen-devel] VCPUOP_set_periodic_timer >> >>>On 14/11/2013 21:18, Simon Martin wrote: >>>>Hi all, >>>> >>>>I need a periodic timer running at ideally at 125 microseconds and=20 >>>>at least 500 microseconds. I've just found the=20 >>>>VCPUOP_set_periodic_timer, however there is a comment saying=20 >>>>"periods less than one millisecond may not be supported". >>>> >>>>I will be running on an x64 machine. Is this supported? If not, is=20 >>>>there any alternate means of generating a fast interrupt? >>>> >>>>Regards. >>> >>>What is the usecase here? 125us is very short indeed. Xen certainly= =20 >>>cant guarantee anything more accurate than 50us. Unless the affected= =20 >>>vcpu is running uncontested on the hardware, there is very little=20 >>>chance that the vcpu will indeed be woken up again in 125us. >>> >>>It sounds as if you are looking for some pseudo realtime system, at=20 >>>which point you might want to consider a different scheduler. >>> >>>~Andrew >>> >> >>-------------------------------------------------------------------------= ------- >>_______________________________________________ >>Xen-devel mailing list >>Xen-devel@lists.xen.org >>http://lists.xen.org/xen-devel --------=_MB3103A119-E60A-48C2-871D-57C7F3D85C0E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Re: [Xen-devel] VCPUOP_set_periodic_timer
Thanks Keir,
 
That sounds quite reasonable. What granularity can I achieve with this= ? Any idea on the jitter?
 
Regards.
 
 
------ Original Message ------
From: "Keir Fraser" <keir.xen= @gmail.com>
To: "Simon Martin" <smartin= @milliways.cl>; "Andrew Cooper" <andrew.cooper3@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Sent: 15/11/2013 08:36:45
Subject: Re: [Xen-devel] VCPUOP_set_periodic_timer
 
The periodic_timer is really a coarse-grained timer for drivi= ng a legacy ticker. It is considered low accuracy and low priority =E2=80= =93 for example, it is stopped entirely while a vcpu is descheduled!
You should use VCPUOP_set_singleshot_timer, and call it again at the end= of your timer handler to get the desired periodic behaviour. If you have= multiple timers in your OS you would manage them in your OS and pick the= nearest deadline to program down to Xen.

 -- Keir

On= 15/11/2013 11:24, "Simon Martin" <smar= tin@milliways.cl> wrote:

Hi Andrew,
 
The operating= system I am trying to port to Xen is an industrial servo controller. We= are currently running at 125 microsecond servo update rate on our bespoke= hardware (at the moment MIPS64 and ARM) (hence the 125 microsecond ideal= interrupt period). We will be driving EtherCAT servo drives that need to= be updated at 500 microseconds (hence at least 500 microsecond interrupt= period). If we can achieve this on a single core ARM11 clocked at 532 MHz,= it must be achievable on PC hardware. As I said before the idea is to dedi= cate a CPU core to this with all other functions running on the other cores= .
 
Luckily we can accept a reasonable amount of jitter on the= EtherCAT network as we can hand over clock synchronisation to a slave. = This gives us a little leeway.
 
Regards.
 
 ------ Original Message ------
From: "Andrew Cooper" <andrew.cooper3@citrix.com>
To: "Simon = Martin" <smartin@milliways.cl>;= "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Sent:= 14/11/2013 18:39:21
Subject: Re: [Xen-devel] VCPUOP_set_periodic_timer<= BR> 
On 14/11/2013 21:18, Simon Martin wrot= e:
Hi all,
 
I need a periodic= timer running at ideally at 125 microseconds and at least 500 microseconds= . I've just found the VCPUOP_set_periodic_timer, however there is a comment= saying "periods less than one millisecond may not be supported".
 =
I will be running on an x64 machine. Is this supported? If not, is ther= e any alternate means of generating a fast interrupt?
 
Regards.=

What is = the usecase here?  125us is very short indeed.  Xen certainly = cant guarantee anything more accurate than 50us.  Unless the affected= vcpu is running uncontested on the hardware, there is very little chance= that the vcpu will indeed be woken up again in 125us.

It sounds = as if you are looking for some pseudo realtime system, at which point you= might want to consider a different scheduler.

~Andrew



<= FONT face=3D"Consolas, Courier New, Courier">______________________________= _________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
--------=_MB3103A119-E60A-48C2-871D-57C7F3D85C0E-- --===============9163810161198750015== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============9163810161198750015==--