Accessing squashfs with lzma compression is ~16% slower in 5.15 when compared to 5.4, on an RPi3 B+
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-raspi (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
On the server image on an RPi3 B+, I run this script:
```
#!/bin/bash -eu
mount_and_read()
{
local snap=$1
local mnt_d=$2
mount "$snap" "$mnt_d"
# We should not use /dev/null here, see
# https:/
tar -cO "$mnt_d"/ > /dev/zeros
}
snap_d=$(mktemp -d)
for i in {1..3}; do
sync && echo 3 > /proc/sys/
time mount_and_read "$1" "$snap_d"
umount "$snap_d"
done
rmdir "$snap_d"
```
With these commands:
$ sudo mount -t tmpfs -o size=400M tmpfs tmpfs/
$ cd tmpfs
$ snap download core22
$ sudo ../measure-
I get these results on 20.04:
real 0m21.667s
user 0m0.302s
sys 0m20.299s
real 0m21.650s
user 0m0.351s
sys 0m20.417s
real 0m21.718s
user 0m0.285s
sys 0m20.528s
On 22.04 server image:
real 0m25.084s
user 0m0.407s
sys 0m23.778s
real 0m25.064s
user 0m0.397s
sys 0m23.768s
real 0m25.051s
user 0m0.369s
sys 0m23.803s
Which is a considerable difference. This affects snaps compressed with xz, and although these measurements are for server the bigger impact is on UC images, where the boot time increases considerably because of this.
summary: |
Accessing squashfs with lzma compression is ~16% slower in 5.15 when - compared to 5.4 + compared to 5.4, on an RPi3 B+ |
tags: | added: kern-3405 |
I have looked into it a bit. I have noticed that some functions were not inlined in 5.15, but were inlined in 5.4. For example `lzma_literal` and `lzma_match` (see difference in System.map). After removing `CONFIG_ DEBUG_SECTION_ MISMATCH= y` from `debian/ rules.d/ 0-common- vars.mk` (I am not sure why it is there, maybe a left over for some debugging), I got those functions to be inlined in 5.15. However while there is some measurable speed gain, it is very small, and it seems to be a only small fraction of the issue.