All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Daniel Castro <evil.dani@gmail.com>
Cc: Keir Fraser <keir.xen@gmail.com>, xen-devel@lists.xensource.com
Subject: Re: Sched_op hypercall small questions
Date: Tue, 20 Sep 2011 18:28:36 -0700	[thread overview]
Message-ID: <4E793DC4.7080808@goop.org> (raw)
In-Reply-To: <CAP2B85-e64NKts_iC21Bh0OL3X3nUh4jLriYfE2+stHkPfMFWg@mail.gmail.com>

On 09/19/2011 11:17 PM, Daniel Castro wrote:
> On Tue, Sep 20, 2011 at 2:41 PM, Keir Fraser <keir.xen@gmail.com> wrote:
>> On 19/09/2011 22:21, "Daniel Castro" <evil.dani@gmail.com> wrote:
>>
>>> Greetings all.
>>>
>>> Some small question regarding schedule poll operation hypercall.
>>>
>>> 1. struct sched_poll poll.timeout is measured in what unit of time?
>>> Secs, ms? ns?
>> It is an absolute system time (rather than a duration), in nanoseconds.
> really an absolute system time?
>
> When the timeout is set and the timeout is reached, the system behaves
> like if the event had been received? i.e the bit is changed?

You specify the timeout in the the form "wake up by time t".  If t is in
the past, it times out immediately.

>>> 2. After issuing the hypercall_sched_op(SCHEDOP_poll, &poll); if no
>>> timeout is used in poll struct how long will I yield the CPU?
>> Until one of the specified event channel ports is pending.
> If the channel port never changes (the event never arrives) then I
> would yield for ever?

If you have events unmasked and you get an unmasked event, then it will
go into the event handler.

>>> 3. If I issue the hypercall and the event never comes is it possible
>>> to to yield the CPU for ever?
>> Yes, if you do not specify a timeout.
> Keir thanks for the answer.
>
> I am trying to read from xenstore, so I have the following:
> I write on my xenstore ring the query I want, then,
> hypercall_event_channel_op(EVTCHNOP_send ...
> If I read the ring inmediatly the answer is not ready so I issue a
> hypercall_sched_op(SCHEDOP_poll, &poll);
> But while I am entering the yield state the answer comes, so the event
> is never seen because it has already been delivered.

It generally only makes sense to poll on masked events.

>
> If I use some way to wait (just for very brief instant) after the
> event_channel_op send then, when I check the ring the answer is there;
> And I do not need to yield the CPU.
>
> Should I issue the wait after the send, rather than when I am about to
> read the answer?

What environment is this in?

    J

  reply	other threads:[~2011-09-21  1:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20  5:21 Sched_op hypercall small questions Daniel Castro
2011-09-20  5:41 ` Keir Fraser
2011-09-20  6:17   ` Daniel Castro
2011-09-21  1:28     ` Jeremy Fitzhardinge [this message]
     [not found]       ` <CAP2B859vtSK_tC0J6HWB_m6hjHKM18vZ7Qh6ABFejCiEfxs+6g@mail.gmail.com>
2011-09-22  5:41         ` Daniel Castro
2011-09-22  6:30           ` Ian Campbell
2011-09-22  7:43             ` Daniel Castro
2011-09-22  8:00               ` Ian Campbell
2011-09-22 10:00                 ` Daniel Castro
2011-09-20  7:33 Jan Beulich
2011-09-20  8:31 ` Daniel Castro
2011-09-20  9:08   ` Jan Beulich
2011-09-20 10:55     ` Daniel Castro
2011-09-20 11:57       ` Jan Beulich
2011-09-20 12:35         ` Daniel Castro
2011-09-20 12:54           ` Jan Beulich
2011-09-20 12:54           ` Ian Campbell
2011-09-20 12:53         ` Ian Campbell

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=4E793DC4.7080808@goop.org \
    --to=jeremy@goop.org \
    --cc=evil.dani@gmail.com \
    --cc=keir.xen@gmail.com \
    --cc=xen-devel@lists.xensource.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 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.