From: dascalu.laurentziu@gmail.com (Laurențiu Dascălu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Scheduling policy
Date: Mon, 04 Apr 2011 15:13:32 +0200 [thread overview]
Message-ID: <4D99C3FC.7080109@gmail.com> (raw)
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
next reply other threads:[~2011-04-04 13:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 13:13 Laurențiu Dascălu [this message]
2011-04-04 15:36 ` Scheduling policy Daniel Baluta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D99C3FC.7080109@gmail.com \
--to=dascalu.laurentziu@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).