* suspending execution within Xen
@ 2005-06-29 11:53 Avi Kivity
2005-06-29 12:03 ` Timenkov Yuri
2005-06-29 12:42 ` Keir Fraser
0 siblings, 2 replies; 5+ messages in thread
From: Avi Kivity @ 2005-06-29 11:53 UTC (permalink / raw)
To: xen-devel
I am trying to send a stream of events about one domain to another. so I
set up a ring between the monitoring domain and xen (not the monitored
domain). however I am having trouble blocking when buffer space runs
out.
the intuitive
while (!buffer_space_available())
do_block();
does not work; do_block() appears to return to guest context, not to the
while loop (is this correct?). the other alternative,
while (!buffer_space_available())
if (!test_and_set_bit(EDF_BLOCKED, &ed->ed_flags))
domain_sleep(ed);
freezes xen solid.
is there a way to do it? am I missing something obvious?
Avi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: suspending execution within Xen
2005-06-29 11:53 suspending execution within Xen Avi Kivity
@ 2005-06-29 12:03 ` Timenkov Yuri
2005-06-29 12:43 ` Keir Fraser
2005-06-29 12:42 ` Keir Fraser
1 sibling, 1 reply; 5+ messages in thread
From: Timenkov Yuri @ 2005-06-29 12:03 UTC (permalink / raw)
To: xen-devel
may be worth using wait queues here? (or schedule())
On Wednesday 29 June 2005 15:53, Avi Kivity wrote:
> I am trying to send a stream of events about one domain to another. so I
> set up a ring between the monitoring domain and xen (not the monitored
> domain). however I am having trouble blocking when buffer space runs
> out.
>
> the intuitive
>
> while (!buffer_space_available())
> do_block();
>
> does not work; do_block() appears to return to guest context, not to the
> while loop (is this correct?). the other alternative,
>
> while (!buffer_space_available())
> if (!test_and_set_bit(EDF_BLOCKED, &ed->ed_flags))
> domain_sleep(ed);
>
> freezes xen solid.
>
> is there a way to do it? am I missing something obvious?
>
> Avi
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
--
Timenkov Yuri
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: suspending execution within Xen
2005-06-29 11:53 suspending execution within Xen Avi Kivity
2005-06-29 12:03 ` Timenkov Yuri
@ 2005-06-29 12:42 ` Keir Fraser
2005-06-29 13:49 ` Avi Kivity
1 sibling, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2005-06-29 12:42 UTC (permalink / raw)
To: Avi Kivity; +Cc: xen-devel
Xen on x86 doesn't support stack-based continuations within the
hypervisor -- that is, there is no way to deschedule the current domain
within Xen and then automatically return to your current point of
execution when you are re-scheduled.
If you have further work to do, before returning to guest context, when
the domain is rescheduled then you need to install your own hook
function into vcpu->arch.schedule_tail. You'll need to xmalloc any
space you need for continuation data.
-- Keir
On 29 Jun 2005, at 12:53, Avi Kivity wrote:
> I am trying to send a stream of events about one domain to another. so
> I
> set up a ring between the monitoring domain and xen (not the monitored
> domain). however I am having trouble blocking when buffer space runs
> out.
>
> the intuitive
>
> while (!buffer_space_available())
> do_block();
>
> does not work; do_block() appears to return to guest context, not to
> the
> while loop (is this correct?). the other alternative,
>
> while (!buffer_space_available())
> if (!test_and_set_bit(EDF_BLOCKED, &ed->ed_flags))
> domain_sleep(ed);
>
> freezes xen solid.
>
> is there a way to do it? am I missing something obvious?
>
> Avi
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: suspending execution within Xen
2005-06-29 12:03 ` Timenkov Yuri
@ 2005-06-29 12:43 ` Keir Fraser
0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2005-06-29 12:43 UTC (permalink / raw)
To: Timenkov Yuri; +Cc: xen-devel
On 29 Jun 2005, at 13:03, Timenkov Yuri wrote:
> may be worth using wait queues here? (or schedule())
Xen's not Linux: the above primitives/functions do not exist.
-- Keir
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: suspending execution within Xen
2005-06-29 12:42 ` Keir Fraser
@ 2005-06-29 13:49 ` Avi Kivity
0 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2005-06-29 13:49 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
On Wed, 2005-06-29 at 13:42 +0100, Keir Fraser wrote:
> Xen on x86 doesn't support stack-based continuations within the
> hypervisor -- that is, there is no way to deschedule the current domain
> within Xen and then automatically return to your current point of
> execution when you are re-scheduled.
>
> If you have further work to do, before returning to guest context, when
> the domain is rescheduled then you need to install your own hook
> function into vcpu->arch.schedule_tail. You'll need to xmalloc any
> space you need for continuation data.
>
this will probably serve. thanks.
> -- Keir
>
> On 29 Jun 2005, at 12:53, Avi Kivity wrote:
>
> > I am trying to send a stream of events about one domain to another. so
> > I
> > set up a ring between the monitoring domain and xen (not the monitored
> > domain). however I am having trouble blocking when buffer space runs
> > out.
> >
> > the intuitive
> >
> > while (!buffer_space_available())
> > do_block();
> >
> > does not work; do_block() appears to return to guest context, not to
> > the
> > while loop (is this correct?). the other alternative,
> >
> > while (!buffer_space_available())
> > if (!test_and_set_bit(EDF_BLOCKED, &ed->ed_flags))
> > domain_sleep(ed);
> >
> > freezes xen solid.
> >
> > is there a way to do it? am I missing something obvious?
> >
> > Avi
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-06-29 13:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-29 11:53 suspending execution within Xen Avi Kivity
2005-06-29 12:03 ` Timenkov Yuri
2005-06-29 12:43 ` Keir Fraser
2005-06-29 12:42 ` Keir Fraser
2005-06-29 13:49 ` Avi Kivity
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.