* Reduce Linux memory requirements for an Embedded PC
@ 2001-03-24 9:59 Petr Dusil
2001-03-24 12:39 ` Andi Kleen
2001-03-24 15:23 ` Stephen C. Tweedie
0 siblings, 2 replies; 7+ messages in thread
From: Petr Dusil @ 2001-03-24 9:59 UTC (permalink / raw)
To: linux-mm
Hello All,
I am developing a Linux distribution for a Jumptec Embedded PC. It is
targeted to an I486, 16MB DRAM, 16MB DiskOnChip. I have decided to use
Redhat 6.2 (2.2.14 kernel) and to reduce its size to fit the EPC. I
have simplified the kernel (removed support of all unwanted hardware),
init scripts and amount of apps I will really need. I do not have
problems with its size on disk (8MB), but I do see a problem in its
memory requirements. It takes now about 11MB. It is too much. I tried to
replace init by sulogin to get bash shell and look into the system
memory as soon as possible, but again without starting any daemon only
with bash running I got 7MB. I am asking you, is there any option to
tell Linux kernel "save the memory" or what are the general
recommendations to minimize amount of memory the kernel consumes?
Thank you very much for an answer,
Petr
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reduce Linux memory requirements for an Embedded PC
2001-03-24 9:59 Reduce Linux memory requirements for an Embedded PC Petr Dusil
@ 2001-03-24 12:39 ` Andi Kleen
2001-03-24 16:21 ` Rik van Riel
2001-03-24 15:23 ` Stephen C. Tweedie
1 sibling, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2001-03-24 12:39 UTC (permalink / raw)
To: Petr Dusil; +Cc: linux-mm
On Sat, Mar 24, 2001 at 10:59:36AM +0100, Petr Dusil wrote:
> Hello All,
>
> I am developing a Linux distribution for a Jumptec Embedded PC. It is
> targeted to an I486, 16MB DRAM, 16MB DiskOnChip. I have decided to use
> Redhat 6.2 (2.2.14 kernel) and to reduce its size to fit the EPC. I
> have simplified the kernel (removed support of all unwanted hardware),
> init scripts and amount of apps I will really need. I do not have
> problems with its size on disk (8MB), but I do see a problem in its
> memory requirements. It takes now about 11MB. It is too much. I tried to
> replace init by sulogin to get bash shell and look into the system
> memory as soon as possible, but again without starting any daemon only
> with bash running I got 7MB. I am asking you, is there any option to
> tell Linux kernel "save the memory" or what are the general
> recommendations to minimize amount of memory the kernel consumes?
One way is to go back to a 2.0 kernel, which uses somewhat less memory.
I did that on a 4MB box. There are also ways to reduce memory usage further
for both 2.0 and 2.2, but it requires a bit of source patching. Basically
you go through nm --size-sort -t d vmlinux and try to reduce all big symbols,
like the static super block array and reducing sizes of preallocated hash
tables (e.g. buffer and networking hash is very big in 2.2)
There are other ways, e.g. with some patching the memory usage of a select()
using program can be significantly reduced. Easiest way is probably to try
2.0 first.
-Andi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reduce Linux memory requirements for an Embedded PC
2001-03-24 9:59 Reduce Linux memory requirements for an Embedded PC Petr Dusil
2001-03-24 12:39 ` Andi Kleen
@ 2001-03-24 15:23 ` Stephen C. Tweedie
1 sibling, 0 replies; 7+ messages in thread
From: Stephen C. Tweedie @ 2001-03-24 15:23 UTC (permalink / raw)
To: Petr Dusil; +Cc: linux-mm
Hi,
On Sat, Mar 24, 2001 at 10:59:36AM +0100, Petr Dusil wrote:
>
> memory as soon as possible, but again without starting any daemon only
> with bash running I got 7MB. I am asking you, is there any option to
> tell Linux kernel "save the memory" or what are the general
> recommendations to minimize amount of memory the kernel consumes?
First of all, bash and glibc are both fairly large chunks of code.
There are much smaller shells available, and there is at least one
miniature libc intended for embedded use.
Secondly, how are you booting the fs? ramdisks (including initrd) are
fairly wasteful of memory if used as a root filesystem; ramfs for
writable data and cramfs for a static boot fs are much better choices.
Cheers,
Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reduce Linux memory requirements for an Embedded PC
2001-03-24 12:39 ` Andi Kleen
@ 2001-03-24 16:21 ` Rik van Riel
2001-03-24 16:56 ` Ingo Oeser
2001-03-24 19:06 ` Andrew Morton
0 siblings, 2 replies; 7+ messages in thread
From: Rik van Riel @ 2001-03-24 16:21 UTC (permalink / raw)
To: Andi Kleen; +Cc: Petr Dusil, linux-mm
On Sat, 24 Mar 2001, Andi Kleen wrote:
> On Sat, Mar 24, 2001 at 10:59:36AM +0100, Petr Dusil wrote:
> > I am developing a Linux distribution for a Jumptec Embedded PC. It is
> > targeted to an I486, 16MB DRAM, 16MB DiskOnChip. I have decided to use
> > Redhat 6.2 (2.2.14 kernel) and to reduce its size to fit the EPC. I
> > have simplified the kernel (removed support of all unwanted hardware),
> One way is to go back to a 2.0 kernel, which uses somewhat less
> memory. I did that on a 4MB box. There are also ways to reduce memory
> usage further for both 2.0 and 2.2, but it requires a bit of source
> patching. Basically you go through nm --size-sort -t d vmlinux and try
> to reduce all big symbols, like the static super block array and
> reducing sizes of preallocated hash tables (e.g. buffer and networking
> hash is very big in 2.2)
I'm willing to work on a CONFIG_TINY option for 2.5 which
does things like this (but I'll have to finish some VM
things first ;)).
regards,
Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...
http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com.br/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reduce Linux memory requirements for an Embedded PC
2001-03-24 16:21 ` Rik van Riel
@ 2001-03-24 16:56 ` Ingo Oeser
2001-03-24 17:31 ` Rik van Riel
2001-03-24 19:06 ` Andrew Morton
1 sibling, 1 reply; 7+ messages in thread
From: Ingo Oeser @ 2001-03-24 16:56 UTC (permalink / raw)
To: Rik van Riel; +Cc: Andi Kleen, Petr Dusil, linux-mm
On Sat, Mar 24, 2001 at 01:21:29PM -0300, Rik van Riel wrote:
> I'm willing to work on a CONFIG_TINY option for 2.5 which
> does things like this (but I'll have to finish some VM
> things first ;)).
Why not 2.4? It is only a configuration thing, right? People are
using Linux more and more for embedded stuff. So waiting 2 years
more is not an option.
I'm willing to help, if we collect some ideas on WHAT to do
first.
I had problems even on 64MB with no swap attached, so this is a
serious problem (look at comment on OOM killer does not trigger).
Esp. in the network layer we need to reduce memory usage, since
this triggered it for me on this oversized box.
Also a set of configs (may be sysctl stuff) to adjust trade-off
decisions on throughput vs. latency or memory vs. speed and the
like.
Autotuning is nice, but has always the chance to fail for corner
cases. Taking these into account to generates too much code
bloat. So making the required tunables available (as already
happend with threads-max, file-max and the like) is supporting
the idea of 'providing features, not policy'.
Regards
Ingo Oeser
--
10.+11.03.2001 - 3. Chemnitzer LinuxTag <http://www.tu-chemnitz.de/linux/tag>
<<<<<<<<<<<< been there and had much fun >>>>>>>>>>>>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reduce Linux memory requirements for an Embedded PC
2001-03-24 16:56 ` Ingo Oeser
@ 2001-03-24 17:31 ` Rik van Riel
0 siblings, 0 replies; 7+ messages in thread
From: Rik van Riel @ 2001-03-24 17:31 UTC (permalink / raw)
To: Ingo Oeser; +Cc: Andi Kleen, Petr Dusil, linux-mm
On Sat, 24 Mar 2001, Ingo Oeser wrote:
> On Sat, Mar 24, 2001 at 01:21:29PM -0300, Rik van Riel wrote:
> > I'm willing to work on a CONFIG_TINY option for 2.5 which
> > does things like this (but I'll have to finish some VM
> > things first ;)).
>
> Why not 2.4? It is only a configuration thing, right? People are
> using Linux more and more for embedded stuff. So waiting 2 years
> more is not an option.
It depends. I definately want to start development on 2.4
and keep some patch around. If things turn out to be trivial
we can submit the patch for 2.4, if not we can keep the
patch separately.
> I'm willing to help, if we collect some ideas on WHAT to do
> first.
- write a script to move all extern inline functions to
a C file and have them compile out-of-line
- drastically reduce (or even abolish) hash tables for
buffer cache, page cache, network routing, sockets, ...
[ if you have 20 items, you may as well walk a list ]
- compile out all kinds of code which make optimisations
that only work for larger machines (dynamic readahead
size reduction, ...)
> Autotuning is nice, but has always the chance to fail for corner
> cases. Taking these into account to generates too much code
> bloat. So making the required tunables available (as already
> happend with threads-max, file-max and the like) is supporting
> the idea of 'providing features, not policy'.
*nod*
regards,
Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...
http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com.br/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reduce Linux memory requirements for an Embedded PC
2001-03-24 16:21 ` Rik van Riel
2001-03-24 16:56 ` Ingo Oeser
@ 2001-03-24 19:06 ` Andrew Morton
1 sibling, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2001-03-24 19:06 UTC (permalink / raw)
To: Rik van Riel; +Cc: Andi Kleen, Petr Dusil, linux-mm
Rik van Riel wrote:
>
> I'm willing to work on a CONFIG_TINY option for 2.5 which
> does things like this (but I'll have to finish some VM
> things first ;)).
That could be hard, because the amount of tinyness which
can be forced on the VM versus, say, IPV4 will vary from
application to application.
I think this is best solved with documentation, frankly.
Just itemise where the large memory-consumers are, how
much they can be reduced, how to reduce them and what
the consequences of this are.
There's quite a bit of stuff out there - just google
for "linux embedded memory requirements reduce".
It's a matter of pulling it all together.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2001-03-24 19:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-24 9:59 Reduce Linux memory requirements for an Embedded PC Petr Dusil
2001-03-24 12:39 ` Andi Kleen
2001-03-24 16:21 ` Rik van Riel
2001-03-24 16:56 ` Ingo Oeser
2001-03-24 17:31 ` Rik van Riel
2001-03-24 19:06 ` Andrew Morton
2001-03-24 15:23 ` Stephen C. Tweedie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox