Skip to content

Commit

Permalink
moss: Prime vfs cache on boot via systemd service
Browse files Browse the repository at this point in the history
Additionally, include a oneshot .service for testing the time to prime w/
a cold vfs cache.

Signed-off-by: Rune Morling <[email protected]>
  • Loading branch information
ermo committed Jan 13, 2025
1 parent 767cd8a commit 87b2c75
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
Binary file modified m/moss/manifest.x86_64.bin
Binary file not shown.
3 changes: 2 additions & 1 deletion m/moss/manifest.x86_64.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"/usr/lib/kernel/cmdline.d/10-amdgpu.cmdline",
"/usr/lib/moss/moss-fstx.sh",
"/usr/lib/systemd/system/moss-fstx.service",
"/usr/lib/systemd/system/moss-prime-asset-store-vfs-cache.service",
"/usr/share/bash-completion/completions/moss",
"/usr/share/defaults/etc/profile.d/80-command-not-found.sh",
"/usr/share/fish/completions/moss.fish",
Expand Down Expand Up @@ -63,6 +64,6 @@
}
},
"source-name": "moss",
"source-release": "76",
"source-release": "77",
"source-version": "0.25.1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=Time to prime moss asset store in vfs cache in the background
RequiresMount=/

[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c "sync && echo 3 > /proc/sys/vm/drop_caches"
ExecStart=/usr/bin/bash -c "time nice -n20 ionice -c Idle find /.moss/assets |xargs --max-lines=1000 --max-procs=$(nproc) stat -t >/dev/null"
10 changes: 10 additions & 0 deletions m/moss/pkg/moss-prime-asset-store-vfs-cache.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Prime moss asset store in vfs cache in the background
RequiresMountsFor=/

[Service]
Type=simple
ExecStart=/usr/bin/bash -c "time nice -n20 ionice -c Idle find /.moss/assets |xargs --max-lines=1000 --max-procs=$(nproc) stat -t >/dev/null"

[Install]
WantedBy=basic.target
6 changes: 5 additions & 1 deletion m/moss/stone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
name : moss
version : 0.25.1
release : 76
release : 77
summary : Serpent OS package manager
license : MPL-2.0
homepage : https://github.com/serpent-os/tools
Expand Down Expand Up @@ -61,3 +61,7 @@ install : |
%install_file boot/module/module-setup.sh %(installroot)%(libdir)/dracut/modules.d/90moss/module-setup.sh
%install_file boot/moss-fstx.service %(installroot)%(libdir)/systemd/system/moss-fstx.service
%install_exe boot/moss-fstx.sh %(installroot)%(libdir)/moss/moss-fstx.sh
# Ensure that blits happen against hot vfs cache (quicker first blits)
%install_file %(pkgdir)/moss-prime-asset-store-vfs-cache.service %(installroot)%(libdir)/systemd/system/moss-prime-asset-store-vfs-cache.service
%install_file %(pkgdir)/moss-benchmark-time-to-prime-asset-store-vfs-cache.service %(installroot)%(libdir)/systemd/system/moss-prime-asset-store-vfs-cache.service

0 comments on commit 87b2c75

Please sign in to comment.