1 |
"Boyd Stephen Smith Jr." <bss03@××××××××××.net> posted |
2 |
200701120717.07604.bss03@××××××××××.net, excerpted below, on Fri, 12 Jan |
3 |
2007 07:16:53 -0600: |
4 |
|
5 |
> Or, on a system where (e.g.) /home is on RAID 6 across 5 disks, and swap is |
6 |
> on RAID 0 across 5 disks (same disks possibly). In this case I/O to swap |
7 |
> is nearly twice as fast, so it may be reasonable to sometimes swap out |
8 |
> pages that are backed by files or even *filesystem cache*. This is, in |
9 |
> fact, fairly similar to my current setup. |
10 |
|
11 |
That's very similar to mine, also, actually. Only here it's a four-disk |
12 |
SATA array, root, root-bak, and an LVM2 hosting partitioned RAID-6 |
13 |
containing most of the system, a RAID-1 /boot, a RAID-0/striped portage |
14 |
tree and temp/scratch/cache space, and /tmp (with /var/tmp symlinked to |
15 |
it) as tmpfs putting part of my 8 gig physical memory to use. Swap is a |
16 |
partition on each of the four drives, set equal priority so the kernel |
17 |
stripes them too. |
18 |
|
19 |
The thing is, however, that if it's read in from disk only to be written |
20 |
out to the swap aka paging device, and it's read-only, you are doing |
21 |
enough additional work to counteract most of the speed gain of even much |
22 |
faster swap, in addition to forcing one to have that much bigger a swap |
23 |
device because it's stored both there and on the regular filesystem. |
24 |
Rather, the kernel just memory-maps the file in from its original |
25 |
location, not even loading it into actual memory unless it's actually |
26 |
needed. No load, only to turn around and write it back out to swap. If |
27 |
it IS loaded into memory because it's actually used, it's either going to |
28 |
be used enough to keep it in cache most of the time, or it's not going to |
29 |
be used all that much, and if the memory needs reclaimed, the kernel |
30 |
simply dumps the physical memory without having to bother writing it to |
31 |
swap since the file is memory-mapped directly on disk as it is. Swap |
32 |
would have to be several times (way more than twice) as fast in ordered to |
33 |
even theoretically make it worth all those additional still-slow I/O |
34 |
operations. |
35 |
|
36 |
It's also worth noting that it's a reasonable assumption that a company or |
37 |
individual having enough money to do the fast striped RAID swap, generally |
38 |
has enough money to buy a reasonable amount of memory as well, thus |
39 |
avoiding routine operational use of swap. While swap may be used some, |
40 |
it's normally not going to be used enough to make the extra I/O worth it |
41 |
to actually read the file in and then page it out to swap, just so it's on |
42 |
the faster swap. |
43 |
|
44 |
-- |
45 |
Duncan - List replies preferred. No HTML msgs. |
46 |
"Every nonfree program has a lord, a master -- |
47 |
and if you use the program, he is your master." Richard Stallman |
48 |
|
49 |
-- |
50 |
gentoo-desktop@g.o mailing list |