[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Kernel stack for a process
On Mon, Sep 09, 2002 at 03:09:51PM -0600, Joseph A. Knapka wrote:
> > > [kernel stack protection using redpages]
> > Iterate over $n processes .. where $n is disturbingly large on some
> > systems.
> Hmm... Why not just look at the stack for "current"?
It isn't exactly that easy -- adding a red page at the end of the stack
space would need to be implemented in one of two fashions: either
allocate a new redpage in the kernel address space on context switch or
allocate a redpage at task creation time.
The first method, allocating a redpage on every context switch, is
likely to be hideously expensive, though it would be more conservative
with memory usage.
The second method, allocating a redpage at task creation time, is
cheaper, but it would throw away a whole page of storage for every task
on the system. On my piddly desktop, that would be throwing away 512k of
memory. (That is a _lot_ of dentries and inodes! :)
Some people are building machines designed to handle 10000 tasks, and
more, without problems.. asking those people to dedicate 40 megabytes to
empty pages isn't going to go over well. :)
--
http://immunix.org/
PGP signature