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_os: fix compile with blk-mq on Linux 4.x #16069

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

robn
Copy link
Member

@robn robn commented Apr 8, 2024

Motivation and Context

Since #15992 was merged, master fails to compile on Linux 4.x.

Description

99741bd accesses a cached blk-mq hardware context through the mq_hctx field of struct request. However, this field did not exist until 5.0. Before that, the private function blk_mq_map_queue() was used to dig it out of broader queue context. This commit detects this situation, and handles it with a poor-man's simulation of that function.

How Has This Been Tested?

Compile checked on kernels:

  • 4.4.302
  • 4.9.337
  • 4.14.336
  • 5.10.214
  • 6.1.38
  • 6.2.16
  • 6.4.15
  • 6.6.23
  • 6.8.2
  • 6.9.0-rc2

I have not checked if this actually makes the zvol multi taskq works properly on 4.x, or even it works at all.

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:

99741bd accesses a cached blk-mq hardware context through the mq_hctx
field of struct request. However, this field did not exist until 5.0.
Before that, the private function blk_mq_map_queue() was used to dig it
out of broader queue context. This commit detects this situation, and
handles it with a poor-man's simulation of that function.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>
@robn
Copy link
Member Author

robn commented Apr 8, 2024

@ixhamza fyi.

@ixhamza
Copy link
Contributor

ixhamza commented Apr 8, 2024

Thanks @robn, and apologies for missing compiling my changes against old kernels.

@tonyhutter
Copy link
Contributor

@ixhamza
Copy link
Contributor

ixhamza commented Apr 8, 2024

@tonyhutter - I believe that is because #16062 is yet to merge to master.

@ixhamza
Copy link
Contributor

ixhamza commented Apr 8, 2024

I have not checked if this actually makes the zvol multi taskq works properly on 4.x, or even it works at all.

@robn - JFYI, I have tested on 4.15 with blk-mq enabled to validate that zvol multi taskq functionality works properly with this patch.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Apr 8, 2024
@behlendorf behlendorf merged commit 03987f7 into openzfs:master Apr 8, 2024
22 of 25 checks passed
ixhamza pushed a commit to ixhamza/zfs that referenced this pull request Apr 16, 2024
99741bd accesses a cached blk-mq hardware context through the mq_hctx
field of struct request. However, this field did not exist until 5.0.
Before that, the private function blk_mq_map_queue() was used to dig it
out of broader queue context. This commit detects this situation, and
handles it with a poor-man's simulation of that function.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Ameer Hamza <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#16069
tonyhutter pushed a commit that referenced this pull request Apr 17, 2024
99741bd accesses a cached blk-mq hardware context through the mq_hctx
field of struct request. However, this field did not exist until 5.0.
Before that, the private function blk_mq_map_queue() was used to dig it
out of broader queue context. This commit detects this situation, and
handles it with a poor-man's simulation of that function.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Ameer Hamza <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes #16069
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Sep 4, 2024
99741bd accesses a cached blk-mq hardware context through the mq_hctx
field of struct request. However, this field did not exist until 5.0.
Before that, the private function blk_mq_map_queue() was used to dig it
out of broader queue context. This commit detects this situation, and
handles it with a poor-man's simulation of that function.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Ameer Hamza <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#16069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants