Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KDE Space Free #112

Closed
behlendorf opened this issue Feb 20, 2011 · 5 comments
Closed

KDE Space Free #112

behlendorf opened this issue Feb 20, 2011 · 5 comments

Comments

@behlendorf
Copy link
Contributor

Devsk is reporting that when using ZFS as the root filesystem that KDE reports there being much less free space than there really is. We need to look in to how KDE is calculating free space in the filesystem and adjust ZFS to accommidate it.

@devsk
Copy link

devsk commented Feb 20, 2011

Here is the relevant code from KDE:

./kio/kfile/kdiskfreespaceinfo.cpp:    struct statvfs statvfs_buf;
./kio/kfile/kdiskfreespaceinfo.cpp:    if (!statvfs(QFile::encodeName(pathArg).constData(), &statvfs_buf)) {
./kio/kfile/kdiskfreespaceinfo.cpp:        const quint64 blksize = quint64(statvfs_buf.f_frsize); // cast to avoid overflow
./kio/kfile/kdiskfreespaceinfo.cpp:        info.d->available = statvfs_buf.f_bavail * blksize;
./kio/kfile/kdiskfreespaceinfo.cpp:        info.d->size = statvfs_buf.f_blocks * blksize;

Is the following field being provided correctly for ZFS:

fsblkcnt_t   f_bavail;  /* free blocks available to
                                      unprivileged user */

I think this probably should be same as f_bfree for ZFS because there is no concept of reservation for 'root' or 'admin' user.

@behlendorf
Copy link
Contributor Author

Thanks for looking this up. So the matching code on the ZFS side is located in zfs_statvfs(). The problem looks to be that KDE is using f_frsize() which is defined to be the fragment size (512b) instead of f_bsize (128k) which is the block size. It's then multiplied by the number of blocks.

This isn't really the right usage but the API is confusing and inconsistent at best. It's probably best for us just to adjust how ZFS reports these values. We can either increase the fragment size to 128k, or drop the block size to 512 bytes. I'd like to try increasing the fragment size first, if you've got a minute please try this change to zfs_statvfs().

-   statp->f_frsize = 1UL << SPA_MINBLOCKSHIFT;
+   statp->f_frsize = zsb->z_max_blksz;

@devsk
Copy link

devsk commented Feb 21, 2011

Brian, Can u please bundle this change with the patch you will have for the showstopper issue? I will try them both together.

@behlendorf
Copy link
Contributor Author

Absolutely, so far I think I understand almost all of the issues which have been opened so I'll work to resolve as many of them as I can next week. Then I'll target an -rc2 candidate once we've gotten the first crop issues out of the way.

@behlendorf
Copy link
Contributor Author

Increase fragment size to block size

The underlying storage pool actually uses multiple block
size. Under Solaris frsize (fragment size) is reported as
the smallest block size we support, and bsize (block size)
as the filesystem's maximum block size. Unfortunately,
under Linux the fragment size and block size are often used
interchangeably. Thus we are forced to report both of them
as the filesystem's maximum block size.

Closed by 05ff35c

richardelling pushed a commit to richardelling/zfs that referenced this issue Oct 15, 2018
Signed-off-by: mayank <mayank.patel@cloudbyte.com>
sdimitro pushed a commit to sdimitro/zfs that referenced this issue Feb 14, 2022
I've been running some different workloads and ran into more trace!
statements that were expensive. This commit changes more trace!
statements to super_trace!
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants