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

[2.2.1] zvol improvements #15500

Closed

Conversation

ixhamza
Copy link
Contributor

@ixhamza ixhamza commented Nov 7, 2023

Motivation and Context

This PR consists of the following three separate commits:

  • Implement internal zvol threading as a property.
  • Fix delayed update to zvol block device ro entry.
  • Cleanup around zvol volmode and snapdev set property.

Description

Detailed descriptions are added in individual commits.

How Has This Been Tested?

Readonly Property:

Before the patch:

# Changing readonly property does not take effect until first IO
zfs set readonly=on tank/zv1
cat /sys/block/zd0/ro 
0
dd if=/dev/zero of=/dev/zvol/tank/zv1 bs=512 count=1
cat /sys/block/zd0/ro 
1

After the patch:

# Changing readonly property immediately takes effect
zfs set readonly=on tank/zv1
cat /sys/block/zd0/ro 
1

zvol threading:

Switched zvol threading for specific zvols and checked through flamegraph:

zfs set volthreading=off tank/zv1
zfs get volthreading tank/zv1
NAME      PROPERTY      VALUE           SOURCE
tank/zv1  volthreading  off             local

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:

zvol_set_volmode() and zvol_set_snapdev() share a common code path.
Merge this shared code path into zvol_set_common().

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes openzfs#15409
Currently, zvol threading can be switched through the zvol_request_sync
module parameter system-wide. By making it a zvol property, zvol
threading can be switched per zvol.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes openzfs#15409
The change in the zvol readonly property does not update the block
device readonly entry until the first IO to the ZVOL. This patch
addresses the issue by updating the block device readonly property
from the set property IOCTL call.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes openzfs#15409
@ixhamza ixhamza mentioned this pull request Nov 7, 2023
13 tasks
Copy link
Contributor

@tonyhutter tonyhutter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this backport!

@tonyhutter
Copy link
Contributor

I pulled these into #15498

@tonyhutter tonyhutter closed this Nov 8, 2023
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.

None yet

2 participants