Is this a ZFS bug, a pacman bug, or working as expected? statp->f_bsize = 128KB leads to over-estimation of free space required #15198
digitalsignalperson
started this conversation in
General
Replies: 3 comments 5 replies
-
The quick and dirty work-around I just did was to change my big
to
which succeeded to split things up enough to reduce the over-estimation error. |
Beta Was this translation helpful? Give feedback.
0 replies
-
If your pool has ashift=12, then modulo special cases like embedded_data, yes, 4k is the smallest anything is going to use for a record. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It seems the question is about stat() call reporting the record size for
the value of stat.st_blksize. So, for the record size of 128k the block
size will be the same. That causes pacman to wildly overestimate the total
size required for gazillion of small files. For the purpose of this
calculation it would be more reasonable to use record size = (1 << ashift).
I wonder what are the other use cases, which better work if we report block
size equal to record size. BTW, this calculation will not account for
compression and dedup FWIW.
…On Tue, Aug 22, 2023 at 10:42 PM Rich Ercolani ***@***.***> wrote:
If your pool has ashift=12, then modulo special cases like embedded_data,
yes, 4k is the smallest anything is going to use for a record.
—
Reply to this email directly, view it on GitHub
<#15198 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXQ6HJQCV5X3WS5HLE4TIDXWSSMPANCNFSM6AAAAAA3ZTSJM4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Provisioning an arch linux system in a VM:
pacman -S
with everything already downloaded and in cache, pacman reports "Net Upgrade Size: 4786.55 MiB" and thenSo the block size is reported as 131072=128KB, and 115656 x 128KB = 14.1G as expected. Yet pacman is asking for 172351 blocks, or a whopping 21GB for a "Net Upgrade Size: 4786.55 MiB"
So what's the problem...
pacman/lib/libalpm/diskspace.c calculate_installed_size() does this
So it's calculating the number of blocks it needs by rounding the size of every file in every package up to 128KB... I think this is the issue leading to a huge over-estimation of the required disk space.
zfs sets
statp->f_bsize = zfsvfs->z_max_blksz;
to the max block size here: https://github.com/openzfs/zfs/blob/cae502c17576694721d290c2506880d0caa872c7/module/os/linux/zfs/zfs_vfsops.c#L1114C39-L1114C39This was another reference I found: #112
My pool uses ashift=12 so is the min block size actually 4096 bytes?
Beta Was this translation helpful? Give feedback.
All reactions