public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: aq <aquynh@gmail.com>
To: Jan Hudec <bulb@ucw.cz>
Cc: suthambhara nagaraj <suthambhara@gmail.com>,
	"Dhiman, Gaurav" <gaurav.dhiman@ca.com>,
	main kernel <linux-kernel@vger.kernel.org>,
	kernel <kernelnewbies@nl.linux.org>
Subject: Re: Kernel stack
Date: Tue, 12 Oct 2004 21:30:54 +0900	[thread overview]
Message-ID: <9cde8bff04101205302834206@mail.gmail.com> (raw)
In-Reply-To: <20041012102731.GQ703@vagabond>

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

  reply	other threads:[~2004-10-12 12:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <577528CFDFEFA643B3324B88812B57FE3055B9@inhyms21.ca.com>
2004-10-12  6:51 ` Kernel stack suthambhara nagaraj
2004-10-12  9:41   ` Jan Hudec
2004-10-12 10:05     ` aq
2004-10-12 10:27       ` Jan Hudec
2004-10-12 12:30         ` aq [this message]
2004-10-12 13:11           ` Jan Hudec
2004-10-12 14:30     ` Jon Masters
2004-10-12 14:31       ` Jan Hudec
2004-10-13  5:03 Thekkedath, Gopakumar
  -- strict thread matches above, loose matches on Subject: below --
2004-10-13  4:35 Dhiman, Gaurav
2004-10-14 19:31 ` Denis Vlasenko
2004-10-12  7:51 Thekkedath, Gopakumar
2004-10-12  6:15 kernel stack suthambhara nagaraj
2004-10-12 11:09 ` Neil Horman
2004-10-13  3:29   ` suthambhara nagaraj
2004-10-14  3:15     ` suthambhara nagaraj
2001-09-11 15:53 Kernel stack Richard J Moore
2001-09-10 21:47 Raghava Raju
2001-09-10 21:57 ` Erik Mouw
2001-09-11 10:31   ` Emmanuel Varagnat
2001-09-11 12:15 ` Richard B. Johnson
2001-08-27 22:24 Raghava Raju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9cde8bff04101205302834206@mail.gmail.com \
    --to=aquynh@gmail.com \
    --cc=bulb@ucw.cz \
    --cc=gaurav.dhiman@ca.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suthambhara@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox