Summary: | "freebsd-update fetch" unnecessary IO when no updates [Fix provided] | ||
---|---|---|---|
Product: | Base System | Reporter: | tux2bsd <tux2bsd> |
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | New --- | ||
Severity: | Affects Many People | CC: | emaste, grahamperrin, pi |
Priority: | --- | Keywords: | performance |
Version: | Unspecified | ||
Hardware: | Any | ||
OS: | Any | ||
URL: | https://reviews.freebsd.org/D32570 |
Description
tux2bsd
2021-10-02 10:12:33 UTC
Forum thread: https://forums.freebsd.org/threads/freebsd-update-fetch-improved-efficiency-please-test-if-youre-interested.82290/ That was supposed to say: "The IO thrashing..." Jose Luis Duran (jlduran) provided some valuable feedback on my patch on Github regarding style and a good question about the case if there is only a kernel update. I came up with a more robust comparison, simply comparing tags rather than trying to ascertain version information (the more obvious approach in hindsight). https://github.com/freebsd/freebsd-src/pull/543/commits Thanks for keeping us in the loop. FYI <https://github.com/freebsd/freebsd-src> is a > … (read-only mirror) Final squashed commit pushed to Github 2 days ago, I'm unsure if the "review" feature of Github is making itself known to Ed Maste. https://github.com/freebsd/freebsd-src/pull/543 The github link(s) above are no longer relevant, see Phabricator: https://reviews.freebsd.org/D32570 https://forums.FreeBSD.org/threads/freebsd-update-fetch-improved-efficiency-please-test-if-youre-interested.82290/post-560325 A different approach (workaround) to this problem. The previous workaround attempt was the right idea but a crude implementation. This is much better: https://github.com/tux2bsd/freebsd-update-probe/blob/main/freebsd-update-probe.sh root@freebsd-dns:~ # time /root/freebsd-update-probe.sh || freebsd-update fetch install freebsd-update-probe.sh found matching tags, no update needed. 0.067u 0.141s 0:00.60 33.3% 119+187k 0+0io 0pf+0w root@freebsd-dns:~ # time freebsd-update fetch install src component not installed, skipped Looking up update.FreeBSD.org mirrors... 2 mirrors found. Fetching metadata signature for 13.0-RELEASE from update2.freebsd.org... done. Fetching metadata index... done. Inspecting system... done. Preparing to download files... done. No updates needed to update system to 13.0-RELEASE-p10. No updates are available to install. 76.380u 22.593s 1:31.64 107.9% 22+170k 0+0io 0pf+0w On a raspberry pi 3B With regard to licensing I made it 2 clause BSD as is freebsd-update from Colin P . A few sections of the code are from freebsd-update direct. The intent is this is for the FreeBSD project/community, let me know if anything needs adjusting with regard to this aspect. My workaround, freebsd-update-probe.sh, provides a definitive measure with regards to room for improvement within freebsd-update. The previous work in https://reviews.freebsd.org/D32570 shows where the fix should be applied but the intertwined nature of freebsd-update does not make this as straight forward as it should be (I bowed out at jail handling, as I do not use them). freebsd-update-probe.sh, satisfies my needs and I have shared it for other people to use if they like. Until this bug is fixed use this, I've provided this utility: https://github.com/tux2bsd/freebsd-update-probe |