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

[ABD] generic abd in vdev_label.c #5555

Closed
wants to merge 1 commit into from
Closed

[ABD] generic abd in vdev_label.c #5555

wants to merge 1 commit into from

Conversation

dpquigl
Copy link
Contributor

@dpquigl dpquigl commented Jan 3, 2017

This is a rebased version of Gvozden Neskovic's patch to remove linear buffer usage in vdev_label converting them to abd structures instead.

@mention-bot
Copy link

@dpquigl, thanks for your PR! By analyzing the history of the files in this pull request, we identified @grwilson, @behlendorf and @tonyhutter to be potential reviewers.

@tuxoko
Copy link
Contributor

tuxoko commented Jan 4, 2017

Can you elaborate why you want to change abd_alloc_linear to abd_alloc_for_io? It seems they are the same thing.

@dpquigl
Copy link
Contributor Author

dpquigl commented Jan 4, 2017

@tuxoko I think the reason for this is that in the future we may change the abd_alloc_for_io implementation to something that works better on Linux. The comment in the code says for now its a linear abd but that could change if certain components change their interfaces.

@tuxoko
Copy link
Contributor

tuxoko commented Jan 4, 2017

From the comment, it seems that this API exists because illumos can only issue linear buffer in the block IO stack. That's not the case in Linux, we only care about the extra copy overhead of the buffer user. This should be solved in a case by case basis, and changing all linear allocation to _for_io doesn't help anything.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

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

From the comment, it seems that this API exists because illumos can only issue linear buffer in the block IO stack. That's not the case in Linux.

Yes, that's right. The intention here is to eventually replace the _for_io() function with on that does the right thing for Linux or Illumos. That means creating a scatter abd for Linux and a linear one for illumos, in order to benefit from this we need to get rid of the existing _linear() consumers which is what this patch does.

err = nvlist_unpack(vp->vp_nvlist,
sizeof (vp->vp_nvlist), &label, 0);

abd_return_buf_copy(vp_abd, vp, sizeof (vdev_phys_t));
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a little thing but let's remove the extra whitespace above.

@@ -934,19 +941,22 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason)
error = nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_SLEEP);
if (error != 0) {
nvlist_free(label);
abd_return_buf_copy(vp_abd, vp, sizeof (vdev_phys_t));
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be abd_return_buf(). There's no reason to copy the borrowed buffer data back in to the abd if we're just going to immediately free it.

@behlendorf behlendorf changed the title [abd] generic abd in vdev_label.c [ABD] generic abd in vdev_label.c Jan 13, 2017
Signed-off-by: Gvozden Neskovic <neskovic@gmail.com>
@behlendorf
Copy link
Contributor

Closing. There's no compelling reason to make this change in the label code which is called relatively infrequently.

@behlendorf behlendorf closed this Jan 26, 2017
@dpquigl dpquigl deleted the abd-vdev-label branch June 28, 2017 19:59
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.

5 participants