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

blk/zoned: Add reset_zones functionality for zoned devices #41076

Closed
wants to merge 1 commit into from

Conversation

Rishabh4275
Copy link
Contributor

Signed-off-by: Rishabh Chawla rishabhchawla1995@gmail.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@github-actions github-actions bot added the core label Apr 29, 2021
@Rishabh4275
Copy link
Contributor Author

Values before reset
Values before reset
Values after reset
Values after reset

@@ -41,6 +41,7 @@ class HMSMRDevice final : public BlockDevice {
string vdo_name;

std::string devname; ///< kernel dev name (/sys/block/$devname), if any
int zbd_file_descriptor; /// zbd_open File Descriptor
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say call this just zbd_dev.

Copy link
Contributor Author

@Rishabh4275 Rishabh4275 Apr 29, 2021

Choose a reason for hiding this comment

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

Updated
Thank you.

@@ -412,6 +412,14 @@ void HMSMRDevice::_detect_vdo()
return;
}

// Will reset the write pointer of all zones from start to end(both inclusive)
bool HMSMRDevice::reset_zones(uint64_t zone_num_range_start, uint64_t zone_num_range_end) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Return int to be consistent with the remaining functions.

Nit: Omit range from parameter names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.
Thank you.

ceph_assert(is_smr());
uint64_t len = (zone_num_range_end + 1 - zone_num_range_start) * zone_size;
ceph_assert(len > 0);
return !zbd_reset_zones(zbd_file_descriptor, zone_num_range_start * zone_size, len);
Copy link
Contributor

Choose a reason for hiding this comment

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

In case of failure it would be useful to print the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@@ -200,6 +200,11 @@ class BlockDevice {
return conventional_region_size;
}

virtual bool reset_zones(uint64_t zone_num_range_start, uint64_t zone_num_range_end) {
ceph_assert(is_smr());
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we should assert here given that right below we return false. Let's see what Ceph folks say.

@agayev
Copy link
Contributor

agayev commented Apr 29, 2021

@tchaikov not sure if @ifed01 or someone else who is responsible forl blk should review this. Please tag the appropriate person. Thanks!

Signed-off-by: Rishabh Chawla <rishabhchawla1995@gmail.com>
@agayev
Copy link
Contributor

agayev commented May 5, 2021

@tchaikov can you please assign this to a reviewer? Thanks.

@@ -200,6 +200,11 @@ class BlockDevice {
return conventional_region_size;
}

virtual uint64_t reset_zones(uint64_t zone_num_start, uint64_t zone_num_end) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this method called anywhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not yet. It will be called in the next PR by the code that cleans zones.

Copy link
Contributor

Choose a reason for hiding this comment

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

i'd like to see how it is used for better understanding of this change. IMHO, it'd be better to have the change which introduces the consumer in the same PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, we will do that.

@Rishabh4275
Copy link
Contributor Author

Shifting to #40923

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@stale
Copy link

stale bot commented Jan 9, 2022

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@stale stale bot added the stale label Jan 9, 2022
@djgalloway djgalloway changed the base branch from master to main July 5, 2022 00:00
@djgalloway djgalloway requested a review from a team as a code owner July 5, 2022 00:00
@github-actions github-actions bot removed the stale label Jul 28, 2022
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Oct 29, 2022
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants