Memory management in embedded linux

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello

I am little confused about the memory managent in Embedded Linux. My
understanding is that, one of the properties of embedded OS it
predictability. And the demand-paging/swapping is something that brings
in un-predictability.

But in practical situations how is demand-paging handled in embedded
linux ? Is it disabled? Are all the pages needed by a process loaded
earlier itself??

Is MMU used in such embedded devices? Can we have a system where MMU is
enabled but demand-paging/swapping is disabled ?

Just how does the whole thing work in embedded Linux system like a
mobile phone????

thanx
Vinay


Re: Memory management in embedded linux
Quoted text here. Click to load it

If you don't have any swap enabled, then you don't have to worry about
pages gone missing.  On the other hand, if something tries to allocate
more memory than is physically available, malloc will fail and the code
will have to deal with that failure gracefully.

Quoted text here. Click to load it

In the Linux systems I've developed we generally had MMUs built in to
the CPU.  We rarely configured any swap space, and sized system RAM much
larger than our worst-case memory needs.

In the one box where there was swap enabled, we actually allocated a
small ram disk and then swapped to that.  Crazy, yes, but we were
working around a bug in the Linux 2.2.18 (?) VM routines - that code
really really expected to have swap available even if it never used it.

Quoted text here. Click to load it

I've never built a mobile phone, and if I did I doubt I'd run Linux on it.

Kelly

Re: Memory management in embedded linux

Quoted text here. Click to load it

I think you still have to worry about demand-paging as
executable pages are read from "disk" as page faults occur.  Of
course, there are ways to get around that by pre-loading and
then locking a process in memory.  

If you're using a RAM disk, is the kernel smart enough to use
read-only (e.g. text segment) pages from the file "in-place"?

There will also be page-faults due to copy-on-write attributes
on data and bss pages in newly forked processes.

Quoted text here. Click to load it

Same here.  The examples I'm thinking of booted from Compact
Flash and didn't have swap enabled.

--
Grant Edwards                   grante             Yow!  RELATIVES!!
                                  at              
We've slightly trimmed the long signature. Click to see the full one.
Re: Memory management in embedded linux
Quoted text here. Click to load it


Did you read the pretty comprehensive responses in the
Linux group for exactly the same question?

Next time, please, cross-post instead of multi-posting,
and think twice about the proper groups.

For the group: the OP got good answers, but he seems
to ignore them.

--

Tauno Voipio
tauno voipio (at) iki fi



Re: Memory management in embedded linux
$ snipped-for-privacy@read3.inet.fi:

Quoted text here. Click to load it

Which "the Linux group" are you refering to?

(I'd like to read the responses too and a quick google search didn't turn
up any responses from you)

--
DYT ikke ved E-mail...

Re: Memory management in embedded linux
Quoted text here. Click to load it

comp.os.linux.embedded, headers:


Path:
read3.inet.fi!central1.inet.fi!nntp.inet.fi!inet.fi!fi.sn.net!newsfeed2.fi.sn.net!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.bit.nl!newsgate.newsserver.nl!feeder.z74.net!news.z74.net!news.glorb.com!postnews.google.com!g47g2000cwa.googlegroups.com!not-for-mail
From: snipped-for-privacy@gmail.com
Newsgroups: comp.os.linux.embedded
Subject: Memory management in embedded Linux
Date: 12 Jul 2005 09:05:53 -0700
Organization: http://groups.google.com
Lines: 20
NNTP-Posting-Host: 203.126.136.223
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1121184358 6148 127.0.0.1 (12 Jul 2005
16:05:58 GMT)
X-Complaints-To: snipped-for-privacy@google.com
NNTP-Posting-Date: Tue, 12 Jul 2005 16:05:58 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: snipped-for-privacy@google.com
Injection-Info: g47g2000cwa.googlegroups.com; posting-host20%3.126.136.223;
    posting-account=8SwinQ0AAABOURbIydqKMTXeq7eC-swW
Xref: central1.inet.fi comp.os.linux.embedded:7233

--

Tauno Voipio
tauno voipio (at) iki fi


Re: Memory management in embedded linux

Quoted text here. Click to load it

Thank you very much, Tauno.

Best regards,
Niels Kristian Jensen

Re: Memory management in embedded linux
Quoted text here. Click to load it

One more reason not to rely on Google for Usenet.  I understand
they can't handle cross-posts at all.  The articles just disappear
from all but one group.

--
"If you want to post a followup via groups.google.com, don't use
 the broken "Reply" link at the bottom of the article.  Click on
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline