Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: paludis Was: glibc-2.6.1 cpu error
Date: Sat, 20 Oct 2007 11:12:51
Message-Id: pan.2007.10.20.10.58.51@cox.net
In Reply to: Re: [gentoo-amd64] Re: paludis Was: glibc-2.6.1 cpu error by Beso
1 Beso <givemesugarr@×××××.com> posted
2 d257c3560710200235p3cfe1396u7e9057fa6a427f84@××××××××××.com, excerpted
3 below, on Sat, 20 Oct 2007 11:35:35 +0200:
4
5 > i have a notebook that i usually shut down more than 3-4 times/day and
6 > the chache problem for me is fundamental. i don't have to wait for
7 > portage almost 7minutes for a world preview update while paludis does
8 > it in less than 2min.
9
10 With mainline kernel suspend-to-disk working, and setting /sys/power/
11 image_size to the largest possible given the size of the swap partition,
12 I've discovered that cache is retained up to that size.
13
14 The default size if nothing is written to image_size is only 500 MB,
15 enough to do a decent job of suspending what's running, but not enough to
16 really get much if any cache.
17
18 However, my swap setup is four partitions of 4 gigs each, each on
19 different drives and with the priority set equal on all four, so the
20 kernel will stripe across all four automatically, thus speeding swap
21 activity dramatically over what it would be with just a single disk.
22 Since the suspend image must be on a single kernel device (and while swap
23 works on combined devices such as RAID, suspend doesn't seem to, even
24 when said devices are assembled from kernel mode directly, before user
25 mode is invoked), that limits me to using a single 4 gig image. More
26 precisely, I can see the active swap devices in /proc/swaps along with
27 their size, and set /sys/power/image_size to the precise swap size in KB
28 shown there for my chosen device, that being 3909 MB (so slightly less
29 than 4 GB) here.
30
31 With a just under 4 GB suspend image size, it's actually roomy enough to
32 retain a decent amount of cache (not all, since I've 8 gigs of memory,
33 but dramatically more than the 500 MB default, that's for sure!), and the
34 cached info from my Gentoo tree and overlays, plus that from the package
35 database, portage config, and world files, is much less than that,
36 significantly less than a gig. In fact, unless I've been copying 5 GB
37 DVD images around or some such, just under 4 GB is quite enough to cache
38 my entire file access profile from boot up thru my normally loaded X and
39 normal working set of apps, and including a routine emerge --update --
40 deep --newuse world run.
41
42 Thus, with a suitable suspend image size, even suspend to disk, and even
43 using the mainline kernel suspend code (no fancy susp2 sources required,
44 tho I'm told it's even /more/ efficient at maintaining cache),
45 maintaining cache isn't a big deal. For the most part, it "just works",
46 once image_size is set correctly.
47
48 Of course, with that big a suspend image, wakeup times are dramatically
49 longer, since it has to read all that extra data back in off of disk.
50 However, it's definitely worth it, since I get back a fully responsive
51 system, not one with virtually no cache, that has to read everything back
52 in before it can actually do anything.
53
54 So... I'd suggest you investigate /proc/swaps and write an appropriate
55 image size to /sys/power/image_size. Assuming you are using at least one
56 swap partition of 2 GB, or even if it's only a single gig, writing an
57 appropriate value to image_size should make your resume MUCH more
58 responsive than it was before, maintaining at least /some/ of your
59 cache. The trade-off will be somewhat longer suspend and resume times,
60 but at least here, I've found it very much worth it. What's great is
61 that this hint is generic enough it should apply to pretty much anyone
62 using suspend to disk, at least on Linux, regardless of what package
63 manager they are using, or even what distribution. IOW, those running
64 Red Hat or Fedora or SuSE or Ubuntu or even Linspire/Freespire, as long
65 as they are using a relatively recent kernel with suspend to disk
66 compiled in, should be able to make use of this. =8^)
67
68 > the one interesting function that i'd like to test is the parallel
69 > compilation feature, which i happened to find by chance in the forum. a
70 > patch that allows portage to compile more packages at the same time if
71 > the second package compiled does not trigger an installation of the
72 > first one. for example i could compile gimp and knetworkmanager at the
73 > same time if i had a good processor.
74
75 I do this all the time, but "manually". That is, I routinely have 2-4,
76 sometimes more (I've had up to 11, more than that I couldn't keep ahead
77 of ensuring I was free of dependencies and doing the etc-updates faster
78 than the things were getting compiled) windows open, compiling different
79 things at the same time. That's especially true when KDE comes out with
80 an update, and I have 90-some packages to update just from it, all coming
81 out the same day.
82
83 When I get my dual dual-cores, I expect it'll be even more so, altho
84 practically speaking, I'm more likely to just set up two compiles at once
85 and then go do something else (like checking the lists =8^) with the rest
86 of my CPU time.
87
88 --
89 Duncan - List replies preferred. No HTML msgs.
90 "Every nonfree program has a lord, a master --
91 and if you use the program, he is your master." Richard Stallman
92
93 --
94 gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] Re: paludis Was: glibc-2.6.1 cpu error Beso <givemesugarr@×××××.com>