

asturm wrote:TMPDIR is for the actual build, it can in no way change anything about dependency calculation.
...whicn never exceeds a minute on my systems, so it would really be interesting what is causing that slowdown for some users.


The kernel will start swapping to free memory.axl wrote:I read a discussion on IRC. I wasn't present, and didn't participate, but those people were suggesting: ahhh.. tmpfs is not that fast. it's actually bad to use it. what if you run out of memory. what do you do then?!
Could you explain why ramfs is so much better than tmpfs? Most people won't set ACLs in a tmpfs, and if the ACL is not set, the cost of supporting it should be very small.axl wrote:First of all, I favor ramfs to tmpfs, which is tmpfs minus all that acl stuff, and second of all, it speeds up a lot of stuff.
I would recommend that this be done only on a system which also stores /, /usr, /etc, /var, etc. in RAM. Since /var/db/pkg records what is installed, you will have a significant mess if you update packages, then lose the associated changes to /var/db/pkg to a shutdown/reboot.axl wrote:and finally, move /var/db/pkg in ram.
/var/db/pkg is the record of what is installed. It is not a particularly efficient representation, but it is easy to manage. Could you explain why you think there would be a substantial memory burden to keeping such a cache? What do you think would be in the cache that is not already persisted today?axl wrote:i dont think portage starts with a list of cashed things it already has installed. it would use too much memory.
The kernel is, in general, quite good at handling caching. If a user program represents data in a way that requires substantial processing to convert from the persisted form to a useful form, kernel caching won't help with that, but neither will forcing the persisted form to be in RAM.axl wrote:yes, also those people on irc believe that kernel cache will handle everything by itself.


The script also has a (trivial) ebuild in the sakaki-tools overlay (here), but you can also just directly download and (after reading, for hygiene!) run it, if you wish.The emtee process runs as follows:
1. Derive a full, versioned build list for the @world set and its entire deep dependency tree, via emerge --with-bdeps=y --pretend --emptytree --verbose [opts] @world, which Portage can do relatively quickly. The resulting list, as it is derived as if no packages were installed to begin with, will automatically contain all necessary packages at their 'best' versions (which may entail upgrades, downgrades, new slots etc. wrt the currently installed set).
2. Filter this list, by marking each fully-qualified atom (FQA=$CATEGORY/$PF) within it for building (or not). Begin with all FQAs unmarked.
* Then (pass 1), mark anything which isn't a block, uninstall or reinstall for build;
* Then (pass 2), check each reinstall, to see if its active USE flag set is changing (default behaviour), or if any of its USE flags are changing (-N/--newuse behaviour), and if so, mark that package for build (fortunately, the --verbose output from step 1 contains the necessary USE flag delta information to allow us to easily work this out).
* Then (pass 3), if -S/--force-slot-rebuilds is in use, for each marked package on the list whose slot or subslot is changing (also inferable from the phase 1 output), search /var/db/pkg/FQA/RDEPENDS (and DEPENDS, if --with-bdeps=y, the default, is active) for any matching slot dependencies. Mark each such located (reverse) dependency that is also on the original --emptytree list (and not a block or uninstall) for build.
Note that pass 3 is skipped by default, since the phase 4 emerge (aka the real emerge) will automatically trigger any necessary slot rebuilds anyway, so it is redundant except for in a few esoteric situations.
3. Iff -c/--crosscheck (or -C/--strict-crosscheck) passed, compare the FQA build list produced by invoking emerge --bdeps=y --pretend --deep --update [--changed-use|--newuse] [opts] @world (adapted for specified options appropriately), with that produced by invoking emerge --oneshot --pretend [opts] . If any differences are found, report them (and, additionally, stop the build in such a case, if -S/--strict-crosscheck specified). Also report a series of comparative (total elapsed wall-clock) timings for both alternatives, for benchmarking purposes.
Note: crosschecking should only be used for reassurance or benchmarking, as it will, of necessity, be slower than the baseline in total time cost (since the check involves running both that and the newer, --emptytree-based approach)! So, if your goal is to improve emerge times, do not pass -s/-S.
4. Invoke the real emerge, as: emerge --oneshot [opts] filtered-FQA-build-list-from-phase-2.
Being a rebel I picked without metadata cache ON PURPOSE and just generate it myself. It's also pretty quick for me because I blacklisted many parts of ::gentoo I don't use like say.. dev-haskell/* is missing for measturm wrote:git doesn't influence dep resolution. Instead, if you picked the wrong mirror without metadata cache, it would explain why you see such long times for dep resolution.

its testing.Hu wrote:The kernel will start swapping to free memory.axl wrote:I read a discussion on IRC. I wasn't present, and didn't participate, but those people were suggesting: ahhh.. tmpfs is not that fast. it's actually bad to use it. what if you run out of memory. what do you do then?!Could you explain why ramfs is so much better than tmpfs? Most people won't set ACLs in a tmpfs, and if the ACL is not set, the cost of supporting it should be very small.axl wrote:First of all, I favor ramfs to tmpfs, which is tmpfs minus all that acl stuff, and second of all, it speeds up a lot of stuff.I would recommend that this be done only on a system which also stores /, /usr, /etc, /var, etc. in RAM. Since /var/db/pkg records what is installed, you will have a significant mess if you update packages, then lose the associated changes to /var/db/pkg to a shutdown/reboot.axl wrote:and finally, move /var/db/pkg in ram./var/db/pkg is the record of what is installed. It is not a particularly efficient representation, but it is easy to manage. Could you explain why you think there would be a substantial memory burden to keeping such a cache? What do you think would be in the cache that is not already persisted today?axl wrote:i dont think portage starts with a list of cashed things it already has installed. it would use too much memory.The kernel is, in general, quite good at handling caching. If a user program represents data in a way that requires substantial processing to convert from the persisted form to a useful form, kernel caching won't help with that, but neither will forcing the persisted form to be in RAM.axl wrote:yes, also those people on irc believe that kernel cache will handle everything by itself.
You might assume that, but I wouldn't. I'm not aware of any specification that requires the kernel to behave in any particular way with regard to retaining data read from files in an in-memory cache, and absent specific documented promises from the relevant developers, I would assume that the caching policy could change in a subsequent release if the maintainers decide they have a better idea about how to handle it.axl wrote:its testing.
it's just testing.
you would assume that if you read every file from /var/db/pkg into the kernel as to cache it, it would not ever be required to redo that operation.
Spectre should not apply here. We are not engaged in speculative execution, merely speculative caching.axl wrote:let's say I have a gentoo portage rsync server. ~ what is it? under a gig of data files. small potatoes. right?
let's say I have a user X doing find /var/db/repos/gentoo (or /usr/portage) -exec dd if='{}' of=/dev/null ';'.
Now, we are getting into specter territory. at least how I perceive it.
I expect the kernel to manage the available cache as best it can within system policy limits, and that "best" is decided based on algorithms maintained by people who spend considerable effort optimizing this.axl wrote:What do you expect from your kernel. and cache management?
I'm not aware of user permissions affecting the kernel's decision of what to speculatively cache. As for root affirmatively pre-caching something with tmpfs, the kernel is free to page out contents from tmpfs if it needs memory elsewhere. Based on how it speculatively pages out content to improve other file caching, it may even swap out a tmpfs to make room to cache files read by a user.axl wrote:A user putting something in ram, maybe, not the best thing to keep in ram, for another user. now if root puts something specifically in ram... now .. that's another story.
Code: Select all
[root@sanziana:/etc/portage/package.env]# free
total used free shared buff/cache available
Mem: 131654016 54979804 55631804 21744 21042408 62485288
Swap: 268435448 85864960 182570488
Sun Jan 12 - 03:44:03