Hi ,

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:

void AcessTaskStruct()
{
struct task_struct *task, *parent;
//struct rq oRq; // initializing the Run queue
struct cfs_rq *cfs_rq;
struct rq *oRq;

char *str;
char *str1= "exe";

// The Following line is very expansive there should be proper reason to iterate for all the process
for_each_process(task)
{

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))
{
oRq->nr_uninterruptible--;
parent = task->parent;
printk("This Process is my Task\n");
printk("The Parents PID =%d\n", parent->pid);
printk("PID = %d\n", task->pid);
//update_curr(cfs_rq);

// While Compiling it is giving error task_rq defined Implecitly
//oRq = task_rq(task);
// Error oRq Size not known
//oRq = __task_rq_lock(&task);
//setscheduler();

task_nice();
//task->sched_class->dequeue_task(oRq, task, 1);

//set_task_state(parent, );
set_task_state(task, 4);


}
}


}

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.