Skip to contentSkip to conversation

realtime scheduling

DISCUSSION Holger Steinhaus 3 participants 5 messages Aug 8, 2005 – Aug 9, 2005

lore
Share & tools
lore
#0 lore raw

Hi everyone,

I am trying to set up an ISDN gateway and PBX system and want to use Xen to seperate some components against each other. Unfortunatly, a necessary device driver (zaphfc) depends on very short latencys for servicing interrupts. This driver is located in domain0 and everything runs fine, as long as all other domains are idling. If the guests get something to do, the zaphfc driver suffers massive buffer under/overflow problems.

I've found some hints about the Atropos realtime scheduler on the list, but some posts say, it is broken currently.

1.) Are there any releases with a working RT-like scheduler?
2.) Do you have any other idea to minimize the scheduling-related latency for domain 0?

Thanks,
Holger

#1 lore raw
Quoted 2 lines · Holger Steinhaus

1.) Are there any releases with a working RT-like scheduler?
2.) Do you have any other idea to minimize the scheduling-related latency for domain 0?

The SEDF scheduler in the 3.0 tree should allow you to specify RT guarantees. Alternatively, if you have a multi-CPU system, or even hyperthreading, you can dedicate a cpu (or hyperthread) solely to domain0.

-- keir

#2 lore raw
Quoted 8 lines · Keir Fraser
Quoted 3 lines · Holger Steinhaus

1.) Are there any releases with a working RT-like scheduler? 2.) Do you have any other idea to minimize the scheduling-related latency for domain 0?

Quoted 6 lines

The SEDF scheduler in the 3.0 tree should allow you to specify RT guarantees. Alternatively, if you have a multi-CPU system, or even hyperthreading, you can dedicate a cpu (or hyperthread) solely to domain0.

-- keir

The default compile of the sedf scheduler is not optimised for latency (but the standard setting might work well...).
You can do a couple of things:
-set the period of dom0 to roughly your latency (better half of it)
and scale your slice accordingly
(e.g. 2ms period, 0.3ms slice...)
-or edit xen/common/schedule_sedf.c and change

     #define UNBLOCK UNBLOCK_EXTRA_SUPPORT
     to
     #define UNBLOCK UNBLOCK_ATROPOS
     and then set the appropriate latancy value in xm sedf (this does

exactly the same thing internaly

Could you please try the second one and see how that works? If it works well, I might change the default behaviour, so that the latency aware scheduler gets enabled for a domain if it uses the latency parameter!

Cheers,
Stephan

#3 lore raw
Quoted 9 lines

The default compile of the sedf scheduler is not optimised for latency (but the standard setting might work well...).
You can do a couple of things:
-set the period of dom0 to roughly your latency (better half of it)
and scale your slice accordingly
(e.g. 2ms period, 0.3ms slice...)

Ok, done. I installed a fresh devel version of Xen (from Aug 7), including kernel 2.6.12.3 and SEDF scheduling (in my original post: Xen 2.0.7, kernel 2.6.11.12, original scheduler). The major change: now the buffer problems even occur without any user domain.

I tried to play around with the period/slice parameters, and found some values that really boost the problems. As the HFC driver generates 8000 interupts per second (I assume for timing purposes), the desired period of 62500 ns is not possible on my machine. I think, I'll take a closer look on the driver first...

Quoted 8 lines

-or edit xen/common/schedule_sedf.c and change

    #define UNBLOCK UNBLOCK_EXTRA_SUPPORT
    to
    #define UNBLOCK UNBLOCK_ATROPOS
    and then set the appropriate latancy value in xm sedf (this does

exactly the same thing internaly

Makes no recognizable difference, in my opinion.

Thanks,
Holger

#4 lore raw
Quoted 3 lines · Holger Steinhaus

Ok, done. I installed a fresh devel version of Xen (from Aug 7), including kernel 2.6.12.3 and SEDF scheduling (in my original post: Xen 2.0.7, kernel 2.6.11.12, original scheduler). The major change: now the buffer problems even occur without any user domain.

I tried to play around with the period/slice parameters, and found some values that really boost the problems. As the HFC driver generates 8000 interupts per second (I assume for timing purposes), the desired period of 62500 ns is not possible on my machine. I think, I'll take a closer look on the driver first...

If that can't be reduced then you really do need to dedicate a CPU or hyperthread to domain0. Otherwise the context switch overheads will kill you, even on a really fast CPU.

-- Keir