Skip to contentSkip to conversation

periodic tasks in Xen

DISCUSSION Diwaker Gupta 2 participants 4 messages Mar 6, 2007 – Mar 12, 2007

lore
Share & tools
lore
#0 lore raw

Hi *,

Whats the recommended way of executing periodic tasks in Xen? I can stick stuff in the scheduler loop, but if there's a neater way of doing this I'd prefer that. I think I should be able to write a function, and have Xen invoke it periodically (via a timer interrupt or some other event?) but I'm not sure about the details. Thoughts?

Also, is there any way of delegating such a periodic task within Xen to a specific core/processor in the system?

TIA,
Diwaker

Signature · 1 line
Web/Blog/Gallery: http://floatingsun.net/blog
#1 lore raw
Quoted 5 lines · Diwaker Gupta

Whats the recommended way of executing periodic tasks in Xen? I can stick stuff in the scheduler loop, but if there's a neater way of doing this I'd prefer that. I think I should be able to write a function, and have Xen invoke it periodically (via a timer interrupt or some other event?) but I'm not sure about the details. Thoughts?

Run it off a timer. See xen/timer.h

Quoted 2 lines

Also, is there any way of delegating such a periodic task within Xen to a specific core/processor in the system?

Xen timers are explicitly bound to a particular core when they are initialised.

-- Keir

#2 lore raw

Thanks Keir. One more question: it seems that the timer is invoked via softirq, which runs in the context of the domain which was executing when the IRQ was raied. Now my timer function sometimes pauses certain domains, and if it pauses the domain in whose context the IRQ was invoked, this causes problems. Is there a better way of doing this?

Thanks,
Diwaker

Quoted 19 lines · Keir Fraser
Quoted 5 lines · Diwaker Gupta

Whats the recommended way of executing periodic tasks in Xen? I can stick stuff in the scheduler loop, but if there's a neater way of doing this I'd prefer that. I think I should be able to write a function, and have Xen invoke it periodically (via a timer interrupt or some other event?) but I'm not sure about the details. Thoughts?

Run it off a timer. See xen/timer.h

Quoted 2 lines

Also, is there any way of delegating such a periodic task within Xen to a specific core/processor in the system?

Xen timers are explicitly bound to a particular core when they are initialised.

-- Keir

Signature · 1 line
Web/Blog/Gallery: http://floatingsun.net/blog
#3 lore raw
Quoted 5 lines · Diwaker Gupta

Thanks Keir. One more question: it seems that the timer is invoked via softirq, which runs in the context of the domain which was executing when the IRQ was raied. Now my timer function sometimes pauses certain domains, and if it pauses the domain in whose context the IRQ was invoked, this causes problems. Is there a better way of doing this?

Don't pause the domain? If you want to pause domains you're probably wanting hypervisor threads. They don't exist, yet. But they likely will in future for potentially expensive operations like domain destruction, page scrubbing, etc.

-- Keir