process Management in linux Kernel
I am new to Linux kernel Programming. I am trying to understand the process management.
i have written a small piece of code to deactivate the userspace task from kernel which is as follows:
struct task_struct *task, *parent;
//struct rq oRq; // initializing the Run queue
struct cfs_rq *cfs_rq;
struct rq *oRq;
char *str1= "exe";
// The Following line is very expansive there should be proper reason to iterate for all the process
printk("state = %d priority= %d [%d]\n",task->state ,task->prio, task->pid);
printk("Executable Name =%s\n", task->comm);
str = task->comm;
// serhing for my task name.
if(!strncmp(str, str1, 3))
parent = task->parent;
printk("This Process is my Task\n");
printk("The Parents PID =%d\n", parent->pid);
printk("PID = %d\n", task->pid);
// While Compiling it is giving error task_rq defined Implecitly
//oRq = task_rq(task);
// Error oRq Size not known
//oRq = __task_rq_lock(&task);
//task->sched_class->dequeue_task(oRq, task, 1);
But the above is not working for me:( So can some one suggest what is the problem here. How can get the pointer to the run queue in the kernel space pro gramme to remove the user space task from the run queue.
Thanks in Advance.