Re: Kernel stack

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

 



> > >From what you all discuss, I can say: kernel memory is devided into 2
> > part, and the upper part are shared between processes. The below part
> > (the kernel stack, or 8K traditionally) is specifict for each process.
> >
> > Is that right?
> 
> No, it's not. There is just one kernel memory. In it each process has
> it's own task_struct + kernel stack (by default 8K). There is no special
> address mapping for these, nor are they allocated from a special area.
> 
> When a context of some process is entered, esp is pointed to the top of
> it's stack. That's exactly all it takes to exchange stacks.

OK, lets say there are 20 processes running in the system. Then the
kernel must allocate 20 * 8K = 160K just for the stacks of these
processes. All of these 160K always occupy the kernel (kernel memory
is never swapped out). When a process actives, ESP would switch to
point to the corresponding stack (of that process).

The remainding memory of kernel therefore is equally accessible to all
the processes.

Is that correct ?

Thank you,
AQ

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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