login
Header Space

 
 

Lost in the kernel, sched.h?

January 4, 2008 - 5:14am
Submitted by Anonymous on January 4, 2008 - 5:14am.
Linux

Hi, doing some kernel hacking but I'm a little lost ...

I want to extend the sched_param structure in /include/sched.h. So that when I create threads with pthreads I can set these new parameters. So I add what I need to the sched_param struct and compile the kernel.

But when I try my new sched_param, I think, its still the old one, just having sched_priority, so I look around and find that pthread.h only have sched_priority in its schad_param struct. Maybe not so strange since I did not change this file ...

I also find the file /usr/include/bits/sched.h on my installation (suse 10.3) and also this file only have sched_priority in it's sched_param struct.

The sched_param in sched.h in the kernel I compiled, and is using, kernelxx/include/linux/sched.h however have that correct parameters ...

So where did my sched_param struct go? where/how do I access it?

kernel/user space

January 5, 2008 - 3:31pm

you seem to be mixing up kernel and user space. to change an interface between kernel and user space you have to modify both sides: the kernel side (what you did) and the user space side (what you did not, you will have to use modified user space headers too). you have to update the actual data transfer (copying the user space struct into the kernel struct in the system call handler and compat handlers) as well, and you have to be backwards compatible in doing that, else you have to recompile every program in your system installation on every change of your interface: programs using the old interface must not stop working.

Ahh, ofcourse, thanks. so if

January 6, 2008 - 8:56pm
Anonymous (not verified)

Ahh, ofcourse, thanks.

so if I have extended sched_param in sched.h in kernel-space I need to do the same in sched.h in user space, in my case /usr/include/bits/sched.h. Hmm, and the I need to extend pthread_create somehow ...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
speck-geostationary