* what's the equivalent function to "schedule_timeout" in xen kernel?
@ 2015-11-16 6:36 Zhangbo (Oscar)
2015-11-16 9:56 ` Andrew Cooper
0 siblings, 1 reply; 4+ messages in thread
From: Zhangbo (Oscar) @ 2015-11-16 6:36 UTC (permalink / raw)
To: xen-devel@lists.xen.org
Cc: Hanweidong (Randy), Yanqiangjun, Huangpeng (Peter),
Herongguang (Stephen), Huangzhichao, Wangyufei (James),
dengkai (A)
Hi all:
I'd like to SLEEP a while in xen kernel during VMEXIT, the easiest way is to call "udelay" or "mdelay" there. However, these 2 functions use busy wait to sleep, which is a waste.
In linux kernel, there's a function named 'schedule_timeout', allowing the CPU to run other tasks during SLEEPING.
So, is there any equivalent function to "schedule_timeout" in xen kernel ?
Thanks in advance.
Oscar.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: what's the equivalent function to "schedule_timeout" in xen kernel?
2015-11-16 6:36 what's the equivalent function to "schedule_timeout" in xen kernel? Zhangbo (Oscar)
@ 2015-11-16 9:56 ` Andrew Cooper
2015-11-16 11:18 ` George Dunlap
2015-11-16 12:35 ` Olaf Hering
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Cooper @ 2015-11-16 9:56 UTC (permalink / raw)
To: Zhangbo (Oscar), xen-devel@lists.xen.org
Cc: Hanweidong (Randy), Yanqiangjun, Huangpeng (Peter),
Wangyufei (James), Huangzhichao, Herongguang (Stephen),
dengkai (A)
On 16/11/15 06:36, Zhangbo (Oscar) wrote:
> Hi all:
> I'd like to SLEEP a while in xen kernel during VMEXIT, the easiest way is to call "udelay" or "mdelay" there. However, these 2 functions use busy wait to sleep, which is a waste.
> In linux kernel, there's a function named 'schedule_timeout', allowing the CPU to run other tasks during SLEEPING.
> So, is there any equivalent function to "schedule_timeout" in xen kernel ?
> Thanks in advance.
>
There is not any equivalent. Paths through Xen are synchronous
(scheduling vCPUS has different requirements/constraints than scheduling
userspace tasks), and there are no concepts of tasks like the Linux
kernel has.
Your only option is to busy wait, but there is probably a different way
of achieving what you are attempting to do.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: what's the equivalent function to "schedule_timeout" in xen kernel?
2015-11-16 9:56 ` Andrew Cooper
@ 2015-11-16 11:18 ` George Dunlap
2015-11-16 12:35 ` Olaf Hering
1 sibling, 0 replies; 4+ messages in thread
From: George Dunlap @ 2015-11-16 11:18 UTC (permalink / raw)
To: Andrew Cooper
Cc: Hanweidong (Randy), Zhangbo (Oscar), Yanqiangjun,
Huangpeng (Peter), xen-devel@lists.xen.org, Herongguang (Stephen),
Huangzhichao, Wangyufei (James), dengkai (A)
On Mon, Nov 16, 2015 at 9:56 AM, Andrew Cooper
<andrew.cooper3@citrix.com> wrote:
> On 16/11/15 06:36, Zhangbo (Oscar) wrote:
>> Hi all:
>> I'd like to SLEEP a while in xen kernel during VMEXIT, the easiest way is to call "udelay" or "mdelay" there. However, these 2 functions use busy wait to sleep, which is a waste.
>> In linux kernel, there's a function named 'schedule_timeout', allowing the CPU to run other tasks during SLEEPING.
>> So, is there any equivalent function to "schedule_timeout" in xen kernel ?
>> Thanks in advance.
>>
>
> There is not any equivalent. Paths through Xen are synchronous
> (scheduling vCPUS has different requirements/constraints than scheduling
> userspace tasks), and there are no concepts of tasks like the Linux
> kernel has.
>
> Your only option is to busy wait, but there is probably a different way
> of achieving what you are attempting to do.
...which implies the question: What is it that you're trying to do?
Why do you want to delay during a vmexit?
-George
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: what's the equivalent function to "schedule_timeout" in xen kernel?
2015-11-16 9:56 ` Andrew Cooper
2015-11-16 11:18 ` George Dunlap
@ 2015-11-16 12:35 ` Olaf Hering
1 sibling, 0 replies; 4+ messages in thread
From: Olaf Hering @ 2015-11-16 12:35 UTC (permalink / raw)
To: Zhangbo (Oscar)
Cc: Hanweidong (Randy), Andrew Cooper, Yanqiangjun, Huangpeng (Peter),
xen-devel, Herongguang (Stephen), Huangzhichao, Wangyufei (James),
dengkai (A)
On Mon, Nov 16, Andrew Cooper wrote:
> On 16/11/15 06:36, Zhangbo (Oscar) wrote:
> > Hi all:
> > I'd like to SLEEP a while in xen kernel during VMEXIT, the easiest way is to call "udelay" or "mdelay" there. However, these 2 functions use busy wait to sleep, which is a waste.
> > In linux kernel, there's a function named 'schedule_timeout', allowing the CPU to run other tasks during SLEEPING.
> > So, is there any equivalent function to "schedule_timeout" in xen kernel ?
> > Thanks in advance.
> >
>
> There is not any equivalent. Paths through Xen are synchronous
> (scheduling vCPUS has different requirements/constraints than scheduling
> userspace tasks), and there are no concepts of tasks like the Linux
> kernel has.
For xenpaging xen/common/wait.c was invented, which gives some sort of
async. The thread of execution goes to sleep, until another thread wakes
it up again.
Olaf
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-11-16 12:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-16 6:36 what's the equivalent function to "schedule_timeout" in xen kernel? Zhangbo (Oscar)
2015-11-16 9:56 ` Andrew Cooper
2015-11-16 11:18 ` George Dunlap
2015-11-16 12:35 ` Olaf Hering
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.