The "update-mime-database" step can take several minutes on my systems, with extremely high disk I/O.
Steps to Reproduce:
1. Emerge a software that adds new mime types (e.g. media-gfx/hugin)
2. Observe the "Updating shared mime info database" step at install with iotop
"update-mime-database" takes 4 minutes to complete (HDD 5400rpm), iotop gets crazy
"update-mime-database" takes a few seconds to complete with low I/O
This issue was already reported in #487504 and fixed with "export ac_cv_func_fdatasync=no" in the ebuild. Sadly this trick doesn't work any more since >=x11-misc/shared-mime-info-2.0
I see 2 possible fixes:
- either set "PKGSYSTEM_ENABLE_FSYNC=0" in xdg-utils.eclass (see https://bugs.freedesktop.org/show_bug.cgi?id=70366 )
- or patch shared-mime-info to disable 'fdatasync' in meson.ebuild
Slow spinning disks are much less common today than they were in 2013/2014 when bug 484504 was open. The performance hit on a solid state disk is probably trivial.
I would suggest setting PKGSYSTEM_ENABLE_FSYNC=0 in make.conf to work around this issue if you are running Gentoo with slow disks.
Regarding the speed yes, but the high write I/O will reduce SSDs lifetime...
I suppose that's a good point.
I guess we can rely on FEATURES="merge-sync" in Portage.
(In reply to Mike Gilbert from comment #3)
> I suppose that's a good point.
> I guess we can rely on FEATURES="merge-sync" in Portage.
Aye, and for e.g. Raspberry Pis on SD cards.
Created attachment 747744 [details, diff]
Patch proposal for Gentoo portage tree eclass
Created attachment 747747 [details, diff]
Patch proposal for x11-misc/shared-mime-info
I attached to patches as fix proposals.
Maybe relying on FEATURES="merge-sync" could be an option too...
The bug has been closed via the following commit(s):
Author: Mike Gilbert <firstname.lastname@example.org>
AuthorDate: 2021-10-24 15:26:17 +0000
Commit: Mike Gilbert <email@example.com>
CommitDate: 2021-10-31 19:32:41 +0000
xdg-utils.eclass: disable fdatasync() in update-mime-database
This speeds up installation dramatically on slow disks, and may reduce
wear on solid state storage.
Portage will call 'sync' after installation if FEATURES="merge-sync" is
enabled, so the risk should be small.
Signed-off-by: Mike Gilbert <firstname.lastname@example.org>
eclass/xdg-utils.eclass | 3 +++
1 file changed, 3 insertions(+)