xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Roland Heusser <heusserr@mail.gvsu.edu>,
	Simon Martin <smartin@milliways.cl>, Sisu Xi <xisisu@gmail.com>,
	Joshua Whitehead <whitehej@mail.gvsu.edu>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Drek Darkover <wackerei@gmail.com>,
	Nate Studer <nate.studer@dornerworks.com>
Subject: Re: VCPUOP_set_periodic_timer
Date: Fri, 15 Nov 2013 22:10:25 +0100	[thread overview]
Message-ID: <1384549825.3896.169.camel@Abyss> (raw)
In-Reply-To: <52860878.8010406@citrix.com>


[-- Attachment #1.1: Type: text/plain, Size: 4838 bytes --]

On ven, 2013-11-15 at 11:41 +0000, Andrew Cooper wrote:
> On 15/11/13 11:24, Simon Martin wrote: 
> > 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
> > dedicate 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.
> >  
> 
> You should investigate using the arinc653 scheduler in Xen, which is a
> realtime scheduler, and might be more appropriate for your usecase.
> 
Right, or even SEDF, if only it were functional! :-/

That's another area where we really need to do better. Luckily enough,
we've got Roland, Joshua and Drek (from GVSU and HsH) working on trying
to 'resurrect' the SEDF scheduler.

Coming to Simon's situation, I think that, as it has already been said,
if you can partition the system in such a way that the real-time VM/OS
gets one full core, without any other interference (either via cpupool
or pinning), there is few point in changing scheduler or scheduling
parameters, and that's probably the setup that would guarantee the most
reliable performances.

If that is not the case, you sure should check arinc, which is probably
a rather "static" algorithm, but I'm quite ignorante (sigh) about how it
actually works, so I can't say anything about it (and I see Nathan is on
it already, so you're in good hands :-)).

If you need something more advanced, while waiting for SEDF to be
'restored', you perhaps can check at RT-Xen (Sisu, one of the main
developers, is also in Cc). Basically, with that, you can enable some
SEDF-alike schedulers, with even more complex and advanced
functionalities.

https://sites.google.com/site/realtimexen/

These schedulers allow you to specify, for each vcpu, a period and a
certain amount of cpu time it will get every period (right Sisu?). This
may turn out to be handy in your case, because you then will have the
guarantee that the vcpu will get a chance to run at least once every
<period> time units. At this point coming up with a period that
guarantees the time granularity that you need shouldn't be too hard,
especially is the system is after all pretty simple, as it looks like.

Of course, it remains to be verified whether the scheduling parameters
can tolerate being set at the small values that your workload
requires... But you cannot get along with a RT-ish system without doing
some measurements, right? :-)

Regards,
Dario

> ~Andrew
> 
> 
> > ------ 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
> >  
> > > On 14/11/2013 21:18, Simon Martin wrote:
> > > 
> > > > 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 there 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
> > > 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-11-15 21:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 21:18 VCPUOP_set_periodic_timer Simon Martin
2013-11-14 21:39 ` VCPUOP_set_periodic_timer Andrew Cooper
2013-11-15 11:24   ` VCPUOP_set_periodic_timer Simon Martin
2013-11-15 11:36     ` VCPUOP_set_periodic_timer Keir Fraser
2013-11-15 11:45       ` VCPUOP_set_periodic_timer Simon Martin
2013-11-15 11:56         ` VCPUOP_set_periodic_timer Keir Fraser
2013-11-15 12:37           ` VCPUOP_set_periodic_timer Simon Martin
2013-11-15 13:10             ` VCPUOP_set_periodic_timer Keir Fraser
2013-11-15 13:13               ` VCPUOP_set_periodic_timer Andrew Cooper
2013-11-15 13:39                 ` VCPUOP_set_periodic_timer Keir Fraser
2013-11-15 11:41     ` VCPUOP_set_periodic_timer Andrew Cooper
2013-11-15 12:02       ` VCPUOP_set_periodic_timer Simon Martin
2013-11-15 12:17         ` VCPUOP_set_periodic_timer Andrew Cooper
2013-11-15 12:46           ` VCPUOP_set_periodic_timer Nate Studer
2013-11-15 12:52             ` VCPUOP_set_periodic_timer Andrew Cooper
2013-11-15 12:54             ` VCPUOP_set_periodic_timer George Dunlap
2013-11-15 21:10       ` Dario Faggioli [this message]
2013-11-16 20:37         ` VCPUOP_set_periodic_timer Simon Martin
2013-11-18 18:28           ` VCPUOP_set_periodic_timer Dario Faggioli
2013-11-26 14:50             ` PV guest timings Simon Martin
2013-11-26 15:11               ` Keir Fraser
2013-11-26 15:38                 ` Simon Martin
2013-11-26 23:33                   ` Dario Faggioli
2013-11-27  2:32                     ` Simon Martin
2013-11-27  8:46                       ` Dario Faggioli
2013-11-27 12:04                         ` Simon Martin
2013-11-27 10:38                   ` David Vrabel
2013-11-27 14:07                     ` Simon Martin
2013-11-26 23:31               ` Dario Faggioli
2013-11-27  2:36                 ` Simon Martin
2013-11-27  8:56                   ` Dario Faggioli
2013-11-27 13:00                     ` Simon Martin
2013-11-28 11:16                       ` Dario Faggioli
2013-11-28 11:57                         ` Simon Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384549825.3896.169.camel@Abyss \
    --to=dario.faggioli@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=heusserr@mail.gvsu.edu \
    --cc=nate.studer@dornerworks.com \
    --cc=smartin@milliways.cl \
    --cc=wackerei@gmail.com \
    --cc=whitehej@mail.gvsu.edu \
    --cc=xen-devel@lists.xen.org \
    --cc=xisisu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).