From: Timothy Miller <miller@techsource.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: A way to shrink process impact on kernel memory usage?
Date: Fri, 09 May 2003 13:10:36 -0400 [thread overview]
Message-ID: <3EBBE10C.4060900@techsource.com> (raw)
One of the things that's been worked on to reduce kernel memory usage
for processes is to shrink the kernel stack from 8k to 4k. I mean, it's
not like you could shrink it to 6k, right? Well, why not? Why not
allocate an 8k space and put various process-related data structures at
the beginning of it? Sure, a stack overflow could corrupt that data,
but a stack overflow would be disasterous anyhow.
I'm sure that, in addition to the memory allocated by kmalloc, some data
structures are also allocated to track it so that you can know what to
free when you use kfree, right? Well, combining a few things this way
would save a few bytes there too.
Also, if you're really worried about overflow, or you want a guard page
or whatever, then put the data structures at the end and set the initial
stack pointer appropriately.
Someone complained about a process structure already being too bloated.
Unless it's several K in size already, you can bloat it up all you
please this way.
Another advantage is that you could make the datastructures growable.
The stack grows down, and the data grows up. As long as they don't
meet, all is well.
next reply other threads:[~2003-05-09 16:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-09 17:10 Timothy Miller [this message]
2003-05-10 20:43 ` A way to shrink process impact on kernel memory usage? David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2003-05-10 1:25 Perez-Gonzalez, Inaky
2003-05-13 14:45 ` Timothy Miller
2003-05-13 19:56 Perez-Gonzalez, Inaky
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=3EBBE10C.4060900@techsource.com \
--to=miller@techsource.com \
--cc=linux-kernel@vger.kernel.org \
/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