-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy to see somebody working on unifying this code. But see some comments inline:
f6c23e2
to
fca8f33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found 4 ways to call zvol, and decided to use next sync/async switching logic dependent of volmode parameter:
geom:
- (1) zvol_geom_bio_start() - sync
- (2) zvol_geom_worker() - async
cdev:
- (3) zvol_cdev_read()/_write() - sync
- (4) zvol_geom_bio_strategy() - async
(1) - the way dependent from geom thread stack usage, case when direct=1.
(2) - case when direct variable value become zero. The direct value is not depend from sync or aio usage.
(3) - normal usage in cdev mode, example: fio with engine=sync.
(4) - used in case of AIO, example: fio with engine=posixaio
Aside of stack usage, some GEOM classes may be unable to use direct I/O due to locking constraints and have to switch into GEOM up/down threads. |
fca8f33
to
7d474c6
Compare
Make zvol I/O requests processing asynchronous on FreeBSD side in some cases. Clone zvol threading logic and required module parameters from Linux side. Make zvol threadpool creation/destruction logic shared for both Linux and FreeBSD. The IO requests are processed asynchronously in next cases: - volmode=geom: if IO request passed thru zvol_geom_worker thread. - volmode=cdev: if IO request passed thru struct cdevsw .d_strategy routine, mean is AIO request. In all other cases the IO requests are processed synchronously. Signed-off-by: Fedor Uporov <fuporov.vstack@gmail.com>
7d474c6
to
0d12476
Compare
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
Checklist:
Signed-off-by
.