From: Eugene Surovegin <ebs@ebshome.net>
To: Stephen Williams <steve@icarus.com>, linuxppc-embedded@ozlabs.org
Subject: Re: Linux processes, tempfs and programs
Date: Thu, 17 Feb 2005 16:59:05 -0800 [thread overview]
Message-ID: <20050218005905.GC10915@gate.ebshome.net> (raw)
In-Reply-To: <20050218004327.GB10915@gate.ebshome.net>
On Thu, Feb 17, 2005 at 04:43:27PM -0800, Eugene Surovegin wrote:
> On Thu, Feb 17, 2005 at 03:38:05PM -0800, Stephen Williams wrote:
> > My embedded system is structured such that the main user-mode
> > processes that are being run are downloaded and executed on demand.
> > I'm currently downloading the executable to an ext3 system on the
> > CompactFlash, but there is really no reason to use non-volatile
> > memory so I'm thinking to download to a tempfs directory and
> > execute from there.
> >
> > But if I do that, I want to remove the program from the directory
> > after I start it, so that the file does not take up ram space. Will
> > that actually work? I'm using exec(2) to execute the program file
> > wherever it is downloaded. Will a subsequent unlink of the file
> > have a result, or will the file continue to take up space as
> > backing store for the executable?
>
> I think unlink will remove the file from directory (so you won't be
> able to see it with ls), but it will still continue to to take space -
> you're right it will be used as backing store, at least for read-only
> segments, which can be discarded if memory is tight. Even if you mlock
> all executable in memory, I think there will be still at least one
> reference to this file, which will prevent freeing tmpfs memory.
A little correction, according to tmpfs doc, it lives completely in
page cache, so I think memory is not wasted for unmodified sections of
the loaded file (e.g. a second copy, when file is executed and loaded
into user-space, isn't being made).
But as usual, make some measurements first :)
--
Eugene.
next prev parent reply other threads:[~2005-02-18 0:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-17 23:38 Linux processes, tempfs and programs Stephen Williams
2005-02-18 0:43 ` Eugene Surovegin
2005-02-18 0:53 ` Stephen Williams
2005-02-18 0:59 ` Eugene Surovegin [this message]
2005-02-18 18:58 ` Stephen Williams
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=20050218005905.GC10915@gate.ebshome.net \
--to=ebs@ebshome.net \
--cc=linuxppc-embedded@ozlabs.org \
--cc=steve@icarus.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;
as well as URLs for NNTP newsgroup(s).