From: Duncan <1i5t5.duncan@cox.net>
To: gentoo-amd64@lists.gentoo.org
Subject: [gentoo-amd64] Re: Unexpected side effect of GCC 4
Date: Mon, 6 Nov 2006 15:51:41 +0000 (UTC) [thread overview]
Message-ID: <einlmd$37e$2@sea.gmane.org> (raw)
In-Reply-To: 200611061144.01773.prh@gotadsl.co.uk
Peter Humphrey <prh@gotadsl.co.uk> posted
200611061144.01773.prh@gotadsl.co.uk, excerpted below, on Mon, 06 Nov
2006 11:44:01 +0000:
> On Monday 06 November 2006 08:41, Duncan wrote:
>
>> Peter Humphrey <prh@gotadsl.co.uk> posted
>> > Perhaps I ought to look into putting /tmp and /var/tmp onto tmpfs.
>>
>> Do so. It makes a /big/ difference!
>
> My reading so far suggests that I include these two lines in /etc/fstab:
>
> tmpfs /tmp tmpfs nodev,nosuid,noexec 0 0
> tmpfs /var/tmp tmpfs nodev,nosuid,noexec 0 0
>
> Is that all I have to do? I assume I don't need to specify tmpfs sizes; I
> have 4 GB RAM of which 0.5 GB is unavailable (owing to a motherboard
> problem that prompted the system builder to refund some of my money -
> small consolation).
I believe I remember your posts talking about that, back when I still had
only a gig of RAM. Now that I have more than 3.5 gig of memory myself, I
know a bit more about the memory hole and all that. If you have bios
entries for configuring it and just couldn't get it to work before, maybe
now that I know a bit more about the issue, we could try to work thru it.
Of course, if you don't have the BIOS entries, it's just not going to
happen...
You don't /need/ to specify tmpfs size, but it might be worthwhile to do
so. You don't want a runaway file in /tmp to take up all your memory and
swap. Be aware that if you mount as tmpfs any location normally
having global write permissions (the usual 1777 of /tmp for instance), you
are letting any account have access to that memory. If you are the only
human user of the machine, that's probably fine, but if not, you may want
to ensure you are running quotas on it or something, and have them set
appropriately.
If you are just concerned about portage, you can of course point
$PORTAGE_TMPDIR at a location other than the default, and set that
location user portage group portage, 740 permissions or similar, so only
portage (and root of course) can write to it. It's still possible that
anyone in group portage could abuse it, but not simple users not in group
portage. then.
Here, as I'm the only human user, I don't have to be quite so strict on
security. To keep things simple, /var/tmp is a symlink to /tmp, so I don't
have to worry about a tmpfs for both dirs. You'll want to set the
following in make.conf:
PKG_TMPDIR
PORTAGE_TMPDIR
PORTAGE_TMPFS
Note that setting the latter to a small, say 50 meg, tmpfs, is useful
even if you aren't setting PORTAGE_TMPDIR on tmpfs. It's used for
quick/small stuff like lockfiles and the like. The portage docs suggest
setting it to /dev/shm, an LSB standard location for such things. I have
a separate (max 50 meg as I said) tmpfs mounted at /dev/shm and followed
the recommendation to point PORTAGE_TMPFS at it.
Of course, you'll only need PKG_TMPDIR if you have FEATURES=buildpkg set
or otherwise deal with binary packages.
I have /tmp (which is where both the package and portage TMPDIRs point) set
size=5g here, with 8 gig memory. With 3.5 gig of memory, you may wish to
set something a bit smaller, say 3 gig. That should be fine for most
emerges and will keep it from going too much into swap if something should
start hogging your tmpfs. Of course, you'll have to make it a bit bigger
for merging say OOo (not the bin-version), as it is said to require 5 gigs
of space (I don't use it so wouldn't personally know), but you could use
remount for special cases like that, keeping it to 3 gig or so normally.
> Probably I should put a script into /etc/conf.d/start.local to create a
> symlink from /var/tmp/ccache back to a real cache directory on disk, as
> it seems daft to install a compiler cache and then flush it at every
> reboot - at present mine has 1.5 GB of data. /tmp has 750 MB of stuff
> and is a separate disk partition at present, mounted on whichever system
> I boot.
Don't worry about that symlink. Set CCACHE_DIR in make.conf directly,
instead. Here, I have it pointed at a subdir on my fast raid-0/striped
array. That works quite well. Since all the stuff portage normally uses
(gcc, grep, sed, libraries commonly linked, etc) read into the regular
kernel filesystem cache memory during the first emerge, and with all the
work being done on tmpfs, there's little i/o but the ccache write updates
going on during all but the qmerge phase of subsequent emerges. The disk
spends most of its time idle, and you can watch the disk activity light
and tell when the kernel's cache flush writes kick in, as it blinks red a
couple times every few seconds. That's it.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
--
gentoo-amd64@gentoo.org mailing list
next prev parent reply other threads:[~2006-11-06 16:12 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-05 8:45 [gentoo-amd64] Unexpected side effect of GCC 4 Peter Humphrey
2006-11-05 10:12 ` [gentoo-amd64] " Duncan
2006-11-05 11:50 ` Peter Humphrey
2006-11-05 12:10 ` Peter Humphrey
2006-11-06 8:17 ` Duncan
2006-11-06 8:29 ` Hemmann, Volker Armin
2006-11-06 15:57 ` Duncan
2006-11-06 7:50 ` Duncan
2006-11-06 8:48 ` Peter Humphrey
2006-11-06 16:01 ` Duncan
2006-11-06 16:06 ` Peter Humphrey
2006-11-06 8:41 ` Duncan
2006-11-06 10:47 ` Hemmann, Volker Armin
2006-11-06 11:48 ` Peter Humphrey
2006-11-06 12:05 ` Hemmann, Volker Armin
2006-11-06 12:49 ` Jack Lloyd
2006-11-06 12:59 ` Hemmann, Volker Armin
2006-11-06 13:06 ` Jack Lloyd
2006-11-06 15:06 ` Peter Humphrey
2006-11-06 11:44 ` Peter Humphrey
2006-11-06 15:51 ` Duncan [this message]
2006-11-08 11:19 ` Peter Humphrey
2006-11-08 15:17 ` Duncan
2006-11-10 10:14 ` Peter Humphrey
2006-11-05 13:24 ` Hemmann, Volker Armin
2006-11-05 23:26 ` Duncan
2006-11-08 10:14 ` [gentoo-amd64] " Peter Humphrey
2006-11-08 11:06 ` [gentoo-amd64] " Duncan
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='einlmd$37e$2@sea.gmane.org' \
--to=1i5t5.duncan@cox.net \
--cc=gentoo-amd64@lists.gentoo.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