All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Get ready queue
@ 2009-06-05 20:38 Thiago Lima
  2009-06-05 22:09 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 8+ messages in thread
From: Thiago Lima @ 2009-06-05 20:38 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

Hi everybody,

I have a function in a linux kernel module that is called whenever a
function in xenomai domain starts. In this moment, i need to get the ready
queue with all ready threads of xenomai.
Do you realize how can i do that ?

Thanks,

-- 
Thiago Lima Silva
Graduando - Ciência da Computação UFBA
Registered Linux user #466887

[-- Attachment #2: Type: text/html, Size: 391 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Get ready queue
  2009-06-05 20:38 [Xenomai-help] Get ready queue Thiago Lima
@ 2009-06-05 22:09 ` Gilles Chanteperdrix
  2009-06-10 19:36   ` Thiago Lima
  0 siblings, 1 reply; 8+ messages in thread
From: Gilles Chanteperdrix @ 2009-06-05 22:09 UTC (permalink / raw)
  To: Thiago Lima; +Cc: xenomai

Thiago Lima wrote:
> Hi everybody,
> 
> I have a function in a linux kernel module that is called whenever a
> function in xenomai domain starts. In this moment, i need to get the ready
> queue with all ready threads of xenomai.
> Do you realize how can i do that ?

If you are using a skin, then you should restrict yourself to the
services of that skin. If you are writing a skin, then the services you
can access are those of the nucleus.

http://www.xenomai.org/documentation/trunk/html/api/group__nucleus.html

If you are writing your own skin, then you can add an xnholder structure
to the TCB of your tasks, it will allow you to walk this list once you
need it.

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Get ready queue
  2009-06-05 22:09 ` Gilles Chanteperdrix
@ 2009-06-10 19:36   ` Thiago Lima
  2009-06-10 19:59     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 8+ messages in thread
From: Thiago Lima @ 2009-06-10 19:36 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

Sorry, i didnt understand you answer.
I get the global queue doing this:

threads = &pod->threadq;    // GLOBAL QUEUE
holder = getheadq(&nkpod->threadq); //HEAD NODE

thanks for helping.

On Fri, Jun 5, 2009 at 10:09 PM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Thiago Lima wrote:
> > Hi everybody,
> >
> > I have a function in a linux kernel module that is called whenever a
> > function in xenomai domain starts. In this moment, i need to get the
> ready
> > queue with all ready threads of xenomai.
> > Do you realize how can i do that ?
>
> If you are using a skin, then you should restrict yourself to the
> services of that skin. If you are writing a skin, then the services you
> can access are those of the nucleus.
>
> http://www.xenomai.org/documentation/trunk/html/api/group__nucleus.html
>
> If you are writing your own skin, then you can add an xnholder structure
> to the TCB of your tasks, it will allow you to walk this list once you
> need it.
>
> --
>                                             Gilles.
>



-- 
Thiago Lima Silva
Graduando - Ciência da Computação UFBA
Registered Linux user #466887

[-- Attachment #2: Type: text/html, Size: 1728 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Get ready queue
  2009-06-10 19:36   ` Thiago Lima
@ 2009-06-10 19:59     ` Gilles Chanteperdrix
  2009-07-17 11:18       ` Thiago Lima
  0 siblings, 1 reply; 8+ messages in thread
From: Gilles Chanteperdrix @ 2009-06-10 19:59 UTC (permalink / raw)
  To: Thiago Lima; +Cc: xenomai

Thiago Lima wrote:
> Sorry, i didnt understand you answer.

The question was vague, so was the answer.

> I get the global queue doing this:
> 
> threads = &pod->threadq;    // GLOBAL QUEUE   
> holder = getheadq(&nkpod->threadq); //HEAD NODE

These are internal data, you are not supposed to access them that way.
Besides threadq is not the ready queue. And with the recent advent of
the scheduler classes, you could not do the same modification for the
latest version of Xenomai. In short, it is a bad idea, really.

If you explained us what you are trying to do (and not how you are
trying to do it), maybe we could help. Chances are that you can do what
you do without changing Xenomai core, simply using hooks for instance.

-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Get ready queue
  2009-06-10 19:59     ` Gilles Chanteperdrix
@ 2009-07-17 11:18       ` Thiago Lima
  2009-07-17 12:14         ` Philippe Gerum
  2009-07-17 12:18         ` Gilles Chanteperdrix
  0 siblings, 2 replies; 8+ messages in thread
From: Thiago Lima @ 2009-07-17 11:18 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1715 bytes --]

I am doing an schedulability test of real time processes in Xenomai. So
that, when a new task is started in system, i need to get all threads from
system, including the new one and make a test to decide if this workset is
schedulable.

I have a linux kernel module with a hook that is called whenever a task is
started. Besides, i have to apply a patch to xenomai kernel in order to
allow the hooks calling when a user space task is started.

My question is: how can i get all ready xenomai tasks ? Because i need to
get the amount of threads to do this test.

Sorry for my last email. I have not so much time to write and it was vague.

att,

Thiago.

On Wed, Jun 10, 2009 at 4:59 PM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Thiago Lima wrote:
> > Sorry, i didnt understand you answer.
>
> The question was vague, so was the answer.
>
> > I get the global queue doing this:
> >
> > threads = &pod->threadq;    // GLOBAL QUEUE
> > holder = getheadq(&nkpod->threadq); //HEAD NODE
>
> These are internal data, you are not supposed to access them that way.
> Besides threadq is not the ready queue. And with the recent advent of
> the scheduler classes, you could not do the same modification for the
> latest version of Xenomai. In short, it is a bad idea, really.
>
> If you explained us what you are trying to do (and not how you are
> trying to do it), maybe we could help. Chances are that you can do what
> you do without changing Xenomai core, simply using hooks for instance.
>
> --
>                                             Gilles.
>



-- 
Thiago Lima Silva
Graduando - Ciência da Computação UFBA
Registered Linux user #466887

[-- Attachment #2: Type: text/html, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Get ready queue
  2009-07-17 11:18       ` Thiago Lima
@ 2009-07-17 12:14         ` Philippe Gerum
  2009-07-17 12:18         ` Gilles Chanteperdrix
  1 sibling, 0 replies; 8+ messages in thread
From: Philippe Gerum @ 2009-07-17 12:14 UTC (permalink / raw)
  To: Thiago Lima; +Cc: xenomai

On Fri, 2009-07-17 at 08:18 -0300, Thiago Lima wrote:
> I am doing an schedulability test of real time processes in Xenomai.
> So that, when a new task is started in system, i need to get all
> threads from system, including the new one and make a test to decide
> if this workset is schedulable.
> 
> I have a linux kernel module with a hook that is called whenever a
> task is started. Besides, i have to apply a patch to xenomai kernel in
> order to allow the hooks calling when a user space task is started.

You are likely using an outdated Xenomai core. 2.4.8 fires the START
callout for userland threads as well.

> 
> My question is: how can i get all ready xenomai tasks ? Because i need
> to get the amount of threads to do this test.
> 

Regarding the Xenomai 2.4 core: include/nucleus/pod.h, follow the readyq
member from the struct xnsched type.

This said, the scheduler innards were heavily rewritten in 2.5, to
provide scheduling classes and more policies than RR+FIFO (e.g. time
partitioning and POSIX sporadic server). So what you would measure for
2.4 may not be relevant with 2.5.

> Sorry for my last email. I have not so much time to write and it was
> vague.
> 
> att,
> 
> Thiago.
> 
> On Wed, Jun 10, 2009 at 4:59 PM, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>         Thiago Lima wrote:
>         > Sorry, i didnt understand you answer.
>         
>         
>         The question was vague, so was the answer.
>         
>         > I get the global queue doing this:
>         >
>         > threads = &pod->threadq;    // GLOBAL QUEUE
>         > holder = getheadq(&nkpod->threadq); //HEAD NODE
>         
>         
>         These are internal data, you are not supposed to access them
>         that way.
>         Besides threadq is not the ready queue. And with the recent
>         advent of
>         the scheduler classes, you could not do the same modification
>         for the
>         latest version of Xenomai. In short, it is a bad idea, really.
>         
>         If you explained us what you are trying to do (and not how you
>         are
>         trying to do it), maybe we could help. Chances are that you
>         can do what
>         you do without changing Xenomai core, simply using hooks for
>         instance.
>         
>         --
>                                                    Gilles.
> 
> 
> 
> -- 
> Thiago Lima Silva
> Graduando - Ciência da Computação UFBA
> Registered Linux user #466887
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
-- 
Philippe.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Get ready queue
  2009-07-17 11:18       ` Thiago Lima
  2009-07-17 12:14         ` Philippe Gerum
@ 2009-07-17 12:18         ` Gilles Chanteperdrix
  2009-07-21 18:46           ` Thiago Lima
  1 sibling, 1 reply; 8+ messages in thread
From: Gilles Chanteperdrix @ 2009-07-17 12:18 UTC (permalink / raw)
  To: Thiago Lima; +Cc: xenomai

Thiago Lima wrote:
> I am doing an schedulability test of real time processes in Xenomai. (...)
> My question is: how can i get all ready xenomai tasks ? Because i need
> to get the amount of threads to do this test.
> 
> Sorry for my last email. I have not so much time to write and it was vague.

I do not think you can do this schedulability test in general, you need
some additional data for each task, such as activation period and WCET,
so, what you should do is use Xenomai 2.5 and create your own scheduler
classes, and keep the list of tasks using these classes, presumably in
the per-class data. Then you would do the schedulatbility test only for
tasks in these classes.

-- 
                                          Gilles



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Xenomai-help] Get ready queue
  2009-07-17 12:18         ` Gilles Chanteperdrix
@ 2009-07-21 18:46           ` Thiago Lima
  0 siblings, 0 replies; 8+ messages in thread
From: Thiago Lima @ 2009-07-21 18:46 UTC (permalink / raw)
  To: Gilles Chanteperdrix, xenomai, rpm

[-- Attachment #1: Type: text/plain, Size: 2048 bytes --]

Thanks for all suggestions and help.

Well, i have extended xenomai nucleus with some data (wcet, activation
period (latency)). Then, i have created system calls so that applications
can inform to system these parameters.

All tasks in the system should pass for schedulability test because we need
to ensure that real time processes worst case computation time will be
respected. So, i cannot create another scheduler class and, for this reason,
i have extended kernel threads. (i could not think another solution)

Indeed, i have applied a patch suggested by Philippe to catch user land
tasks whenever they start. As soon as possible, I will update to xenomai 2.5
core to test the module and an application.

There, now, 2 main questions:

1) I need to do some divisions in this module, but i could not use FPU in
kernel. How do you handle this in xenomai nucleus ? Are there some examples
of use in xenomai kernel code ?

2) I am not yet considering threads with same priority. (cause i know
xenomai uses RR or FIFO with them). How can i get list of threads with an
specific priority ? Is there some example (reference) in xenomai kernel
code?


Thanks for help,

Thiago.


On Fri, Jul 17, 2009 at 12:18 PM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Thiago Lima wrote:
> > I am doing an schedulability test of real time processes in Xenomai.
> (...)
> > My question is: how can i get all ready xenomai tasks ? Because i need
> > to get the amount of threads to do this test.
> >
> > Sorry for my last email. I have not so much time to write and it was
> vague.
>
> I do not think you can do this schedulability test in general, you need
> some additional data for each task, such as activation period and WCET,
> so, what you should do is use Xenomai 2.5 and create your own scheduler
> classes, and keep the list of tasks using these classes, presumably in
> the per-class data. Then you would do the schedulatbility test only for
> tasks in these classes.
>
> --
>                                           Gilles
>
>

[-- Attachment #2: Type: text/html, Size: 2508 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-07-21 18:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-05 20:38 [Xenomai-help] Get ready queue Thiago Lima
2009-06-05 22:09 ` Gilles Chanteperdrix
2009-06-10 19:36   ` Thiago Lima
2009-06-10 19:59     ` Gilles Chanteperdrix
2009-07-17 11:18       ` Thiago Lima
2009-07-17 12:14         ` Philippe Gerum
2009-07-17 12:18         ` Gilles Chanteperdrix
2009-07-21 18:46           ` Thiago Lima

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.