From mboxrd@z Thu Jan 1 00:00:00 1970 From: dascalu.laurentziu@gmail.com (=?UTF-8?B?TGF1cmVuyJtpdSBEYXNjxINsdQ==?=) Date: Mon, 04 Apr 2011 15:13:32 +0200 Subject: Scheduling policy Message-ID: <4D99C3FC.7080109@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hello, I'm trying to implement a simple scheduling policy in the Linux kernel, but I'm not sure if I correctly understand the sched_class interface. Specifically, I would like to know more about the following functions: * put_prev_task(struct rq *rq, struct task_struct *prev) Q: It means the prev was preempted and I have to reschedule another task? Or I have just to add prev to the running queue? The code should look something like: if (prev->se.on_rq) { enqueue_task(rq, prev); } or I'm wrong? * task_tick(struct rq *rq, struct task_struct *p, int queued) Q: Should I preempt the task p, by calling resched_task? What does "queued" means? Thanks, -- Lauren?iu Dasc?lu