All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nocia <nocia.one@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-core] How to get the next periodic task awakening
Date: Wed, 01 Jul 2009 12:05:07 +0200	[thread overview]
Message-ID: <4A4B34D3.3090004@domain.hid> (raw)

Hi all,

I'm a beginer in the Xenomai world.


I'm working on the Xenomai kernel in order to minimize the power
consumption, for my university final project
(/http/://xenomaiote.googlecode.com).

To do that I'm trying to implement OTE (one time extension).


For OTE, I need to know if tasks are in the ready queue that I can do
with countpq(&sched->readyq)

However I have also to know when the next periodic task will wake up to
know the available time that I can use to extends the current task.

But I didn't find this information.

I try this following things in the schedule function xnpod_schedule (pod.c):


To get the next timer that will wake up :

xntimerq_head(&sched->timerqueue)


To get the date of the next wake up :

xntimerh_date(&timer->aplink)


Then I compare this date with the date of the next ingoing task (except
the root task) with xnarch_get_cpu_tsc()


But the results aren't convincing :

Jul 1 11:13:23 rt-nocia kernel: [ 252.872275] now: 263916522565

Jul 1 11:13:23 rt-nocia kernel: [ 252.872285] Name thread out : trivial2

Jul 1 11:13:23 rt-nocia kernel: [ 252.872292] Name thread in : ROOT/0

Jul 1 11:13:23 rt-nocia kernel: [ 252.872297] nb in queue 0

Jul 1 11:13:23 rt-nocia kernel: [ 252.872303] next event *263920282098*

Jul 1 11:13:23 rt-nocia kernel: [ 252.872317]

Jul 1 11:13:24 rt-nocia kernel: [ 253.879348] now: *264923529578*

Jul 1 11:13:24 rt-nocia kernel: [ 253.879362] Name thread out : ROOT/0

Jul 1 11:13:24 rt-nocia kernel: [ 253.879369] Name thread in : trivial

Jul 1 11:13:24 rt-nocia kernel: [ 253.879374] nb in queue 1


The next event is 263920282098 and when the task is scheduling, the
current time is 264923529578.


Maybe it's because I have to get the second timer ?


Thanks in advance for any help!


Lucien



             reply	other threads:[~2009-07-01 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 10:05 Nocia [this message]
2009-07-01 11:43 ` [Xenomai-core] How to get the next periodic task awakening Gilles Chanteperdrix

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=4A4B34D3.3090004@domain.hid \
    --to=nocia.one@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.