Re: list_head and struct_task

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

 



On Wed, Dec 31, 2008 at 6:25 AM, Shyam Burkule <shyam.burkule@xxxxxxxxx> wrote:
> Hi All,
>       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.
>
> I did not understand how scheduler gets process desciptor address

if it is:

static LIST_HEAD(task_groups);

then the addresses are hardcoded after compilation, so it is basically
a fixed kernel address.

But the above symbol is not compiled in my vmlinux.

The one found is this (rq is per-CPU):

nm vmlinux|grep runqueu
c14ba280 d per_cpu__runqueues

And in source (kernel/sched.c):

static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);

> corrosponding to list_head, which it (scheduler) gets from runqueue list??
> Please point me to code gthat does this translation.
>
>

so to emphasize, it is a fixed kernel address.   globally accessible
or not depends on "static" is specified in source (which is YES in our
case, so the symbol is only accessible within sched.c, but of course u
can always access it from anywhere else.........if u know how?)

-- 
Regards,
Peter Teoh

Ernest Hemingway - "Never mistake motion for action."

--
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