Re: list_head and struct_task

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 02 January 2009 09:22:30 Shyam Burkule wrote:
> Thanks for your replay.
>
> On Fri, Jan 2, 2009 at 2:23 AM, Henrik Austad <henrik@xxxxxxxxx> wrote:
> > On Tuesday 30 December 2008 23:25:39 Shyam Burkule wrote:
> > > Hi All,
> >
> > Hi!
> >
> > >       Linux kernel make use list_head to link process descriptor. I am
> > > reading scheduler part of Linux kernel. There is structure *runqueue*
> >
> > that
> >
> > > contains list of all runnable process. The *runqueue* has pointer to
> > > *prio_array_t* structre that have field *queue*(array of struct
> > > prio_array_t) which list process according to priority. The scheduler
> >
> > gets
> >
> > > head_list from this queue.
> >
> > First, which version of the kernel are you working with?
>
> I am working with kernel version 2.6.27.6.

ah, ok, see below :-)

> > From what you ask, it
> > sounds like you are working with the O(1) scheduler setup.
> >
> > as Peter said, there's a individual instance of the runqueue,
> > (kernel/sched.c
> > struct rq). In this rq, you will find a cfs_rq struct (the runqueue for
> > normal tasks) as well as a rt_rq struct. In these runqueues are the tasks
> > runnable on a given CPU.
> >
> > The only place you will find prio_array, will be in the rt_rq runqueue,
> > which
> > has been renamed to rt_prio_array (as normal tasks do not use prio-array
> > but
> > red-black trees nowadays).
>
> But in UTLK I read that prio_array_t is used for both real-time and normal
> processes.

Ah, ok. I get it. Your problem is that UTLK is a bit outdaten on the 
scheduling part. UTLK covers 2.6.10 (as stated in the preface I think), and 
CFS was introduced (together with a lot of other new features) in the 
scheduler in 2.6.23.

I have made an attempt to explain the difference, and how CFS works in my 
specialization project (http://folk.ntnu.no/henrikau/sched/rt_sched_pro.pdf 
section 2.3)

Hopefully this can clearify a few things.


The rest of the container_of was answered brilliantly by Alexander, so I'll 
snip that part off.

-- 
 -> henrik

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux