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

zvol: Enable zvol threading functionality on FreeBSD #17169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fuporovvStack
Copy link
Contributor

Motivation and Context

Make zvol I/O requests processing asynchronous on FreeBSD side. Clone zvol threading logic and required module parameters from Linux side. Make zvol threadpool creation/destruction logic shared for both Linux and FreeBSD. Use OS physio routines in async mode, in case if zvol is exported in cdev mode. Disable volthreading zfs parameter on FreeBSD side by default.

Description

The reason of making volthreading=off by default on FreeBSD side is the poor performance for single zvol fio tests with voltreading=on comparing with normal mode. The problem lays on FreeBSD side.
The FreeBSD does not supports async IO correctly for zvols or any other char devices. We solved this problem for zvols in volmode=dev by modifying FreeBSD AIO logic under aio_qbio() function. It works synchronously, as could be seen from here.
But it is possible to add additional aio_queue function pointer to struct cdevsw, like it doing in struct fileops for example, and pass struct kaiocb AIO objects directly to zvol, where it will be processed asynchronously. In this case the viewable AIO requests performance increasing could be achieved.
If this PR will be accepted, I am ready to start work on modifications for FreeBSD.

How Has This Been Tested?

The tests/functional/zvol/zvol_stress/zvol_stress.ksh testcase was modified to have volthreading on FreeBSD side.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Make zvol I/O requests processing asynchronous on FreeBSD side. Clone
zvol threading logic and required module parameters from Linux side.
Make zvol threadpool creation/destruction logic shared for both Linux
and FreeBSD. Use OS physio routines in async mode, in case if zvol is
exported in cdev mode. Disable volthreading zfs parameter on FreeBSD
side by default.

Signed-off-by: Fedor Uporov <fuporov.vstack@gmail.com>
@fuporovvStack
Copy link
Contributor Author

@amotin, @markjdb

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

Successfully merging this pull request may close these issues.

1 participant