Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How can I control size of /run (tmpfs)?
Date: Mon, 28 May 2012 21:20:31
Message-Id: CA+czFiCoOZT=4L2_V5GdQitq0NPA8sb4CtV1Y384oqasT=B5Ew@mail.gmail.com
In Reply to: Re: [gentoo-user] How can I control size of /run (tmpfs)? by Jarry
1 On Mon, May 28, 2012 at 3:24 PM, Jarry <mr.jarry@×××××.com> wrote:
2 > On 28-May-12 20:58, Michael Mol wrote:
3 >
4 >>>>> Q2: Can I turn this "/run in tmpfs" feature off?
5 >>
6 >>
7 >> Up front: I don't know. Not my area of expertise, but I also don't
8 >> think you've given enough information about your system to really
9 >> answer.
10 >>
11 >> 1) Are you using openrc or systemd? (which version?)
12 >
13 >
14 > openrc 0.9.8.4
15
16 I'll let someone more familiary with openrc figure out if/how you'd
17 reconfigure it wrt /run.
18
19 >
20 >
21 >> 2) Are you using an initramfs? (Generated by what version of what?)
22 >
23 >
24 > no, but I might be forced to use it later when udev >=181 becomes
25 > stable.
26
27 Is your /usr on a separate partition?
28
29 [snip]
30
31 >> But why would you want to?
32 >
33 >
34 > I do not see any advantage in having /run on tmpfs.
35 >
36 >> will be automatically moved to your swap partition if doing so
37 >> benefits your system.
38 >
39 >
40 > I'm not sure it is true. I have read somewhere that tmfps is
41 > never moved to swap.
42
43 Then you didn't read the link I gave above, which points directly to
44 the kernel documentation on tmpfs. Here's the link again:
45
46 http://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt
47
48 > Anyway, I prefer not using swap at all.
49
50 I'm *generally* of the same opinion, but I budge here and there. I try
51 to have enough RAM in my various systems that I can build chromium and
52 libreoffice without things getting shoved to swap. (Heh. There's a
53 losing battle, especially when I parallelize stuff so much. And have
54 you seen the RAM consumed by ld in chromium's final link stages?)
55
56 > And I have better use for physical memory than holding some
57 > more-or-less statical data...
58
59 This is *exactly* what swap is for.
60
61 http://kerneltrap.org/node/3000
62
63 If you have, e.g. five terabytes of swap space and five terabytes of
64 RAM, and you set vm.swappiness to 0, your swap space will never get
65 touched. (Unless you somehow manage to consume all your RAM.)
66
67 In such a scenario, it'd be like not having any swap at all.
68
69 With that in mind, whether or not you have any swap, your only
70 sacrifice is how much space on a block device you sacrifice for a swap
71 partition. With the exception of some virtual machines, none of my
72 systems have drives smaller than 160GB. Discount laptops and mobile
73 devices, and none of my systems have drives smaller than 500GB. One
74 can easily throw 1GB of disk at swap (which then never gets used) and
75 not notice it in filesystem volume; I have running ext* filesystems
76 with more intrinsic overhead than that.
77
78 [snip]
79
80 --
81 :wq