Re: Kernel stack
From: aq (aquynh_at_gmail.com)
Date: 10/12/04
- Previous message: Sami Farin: "2.6.9-rc4 Oops in s_show / prune_dcache"
- In reply to: Jan Hudec: "Re: Kernel stack"
- Next in thread: Jan Hudec: "Re: Kernel stack"
- Reply: Jan Hudec: "Re: Kernel stack"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 12 Oct 2004 21:30:54 +0900 To: Jan Hudec <bulb@ucw.cz>
> > >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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Sami Farin: "2.6.9-rc4 Oops in s_show / prune_dcache"
- In reply to: Jan Hudec: "Re: Kernel stack"
- Next in thread: Jan Hudec: "Re: Kernel stack"
- Reply: Jan Hudec: "Re: Kernel stack"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|