Re: Changing Kernel thread priorities

From: Monica Puig-Pey
Date: Tue Jun 07 2011 - 04:32:30 EST


El 07/06/11 10:27, Johannes Bauer escribiÃ:
Absolutly correct!

However, if you are running the system on an embedded platform, where the _WHOLE_ system (including priorities) is preconfigured and never touched, starting a irq thread with the right prio from start is a more straightforward method than having to invoke a script that changes it using userspace chrt tool.

Regards JB
----- UrsprÃngliche Nachricht -----
Von: "Peter Zijlstra"<peterz@xxxxxxxxxxxxx>
Erhalten: 07.06.2011 00:36
An: hannes_bauer@xxxxxx

"Monica Puig-Pey" wrote:

I need to change the priority from inside the driver, when creating the
kernel thread.

No you don't. How does you driver know about what priority is correct
wrt all the other running RT tasks on the system?

Determining the right priority in a fixed priority scheduling system is
a system wide problem, nobody but the administrator can possibly even
begin to solve it.

There's a reason all RT irq threads are started at 50, its plain
impossible to do better.


That's it!
If I work with embedded system where I know all my tasks running and there is not a user how could I do it?

What I tried is create the kernel thread in my init_module using:

#include <linux/kthread.h>

struct task_struct *kthread_create(int (*threadfn)(void *data),
void *data,
const char namefmt[], ...)
and then running it with:

#include <linux/sched.h>

extern int wake_up_process(struct task_struct *tsk);

These functions stars a Kthread which has a NON RT priority. I can see this using the ps command from user space.
Because it's not a real time thread is why I want, better need, to change its priority, to have only real time threads running in my driver. I want to use the Kthread as a bottom half for the interrupts.

How could I create real time kernel threads then? is kthread_create wrong for real time enviroment?


--
__________________________________________________________________________________

MÃnica Puig-Pey GonzÃlez E-mail: puigpeym@xxxxxxxxx

Grupo de Computadores y Tiempo Real, Departamento de ElectrÃnica y Computadores.
Facultad de Ciencias - Universidad de Cantabria
Av. de los Castros s/n. 39005 - Santander, EspaÃa
__________________________________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/