[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sched_find_first_bit()
Hi,
I've had difficulties to learn the kernel2.6 scheduler recently.
Although I've asked a similar question before in this ML, may I ask
again with a little more detail?
In 2.6, it seems to use "sched_find_first_bit()" function to find the
highest priority task.
This function calculates the index of the highest priority queue by
"array->bitmap" and it's definited in "bitops.h".
But I can't understand why it can return the index we want.
"array->bitmap" must be set by __set_bit() function. I see this function
just only set a bit. So, what relationship is between "__set_bit()" and
"sched_find_first_bit()". I mean how "array->bitmap" works to find the
highest priority task?
Additionally, the kernel 2.6 scheduler, so-called O(1) scheduler, is
said to have two priority-ordered queues, active & expired.
But I see they're not priority-ordered queues because we use Bitmap to
find the highest priority task. What do you think about it?
Regards,
--
Shinpei Kato <shinny@j02.itscom.net>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/