-
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
Fix accounting error for pending sync IO operations in zpool iostat #15478
Fix accounting error for pending sync IO operations in zpool iostat #15478
Conversation
While it is kind of nice from point of being consistent with AVL-trees, lists are used in tons of places, there it would be a waste of 8 bytes per list, plus a dirty cache line for most of modifications, and all of it just for (yes, useful, but) cosmetic issue. I wonder how often that stat is required and whether it would be cheaper to count the elements (may be not, just a thought). I could feel some better if in process we'd also remove list_size from field there, used on Linux and FreeBSD only for a single assertion (I wonder if it was used on Illumos by debugger). And/or if we use it for something else, may be we could balance ARC and dbuf cache evictions using it or something like that. |
Part of the reason for this PR was doing investigations with small recordsize performance with the O_DIRECT PR (#10018). I agree that an unfortunate side effect of this would be inflating such a commonly used data structure by 8 bytes. It would make more sense if the length could also be leveraged in other parts of the code. Another alternative is this counter could just as easily be placed in the |
Placing the length in the |
ecb9c79
to
154debb
Compare
I have moved the counter to |
154debb
to
8e59cee
Compare
I'd be OK about it, just we do not need a counter for every priority level, only for those that use lists. We could fit it into current size would we do:
, combined with list_size removal I mentioned. |
8e59cee
to
0c4896d
Compare
Okay, I see that makes sense. I have gone ahead and made those changes. |
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.
Thanks, but I didn't mean list_size removal in the same commit. It could be separate for readability.
Besides similar struct avl_tree we could possibly leave it in user-space for some libzfs ABI compatibility. I haven't checked, but I guess it may be used somewhere in public structures. Or we could remove them both at one time.
Currently vdev_queue_class_length is responsible for checking how long the queue length is, however, it doesn't check the length when a list is used, rather it just returns whether it is empty or not. To fix this I added a counter variable to vdev_queue_class to keep track of the sync IO ops, and changed vdev_queue_class_length to reference this variable instead. Signed-off-by: MigeljanImeri <[email protected]>
0c4896d
to
e7d5e1e
Compare
Okay, I see I've removed the list_size removal from the commit. |
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.
Thanks. Will you open a separate PR for that, or you'd like me to?
I can open a separate PR, should I keep |
I've tried to search ZFS libraries for lists use and found only implementation in libspl, nothing else. But just to be safer I think we could do it as two commits in one PR, one only for kernel and one for user-space. This way the first could be merged into 2.2, while the second remain in master till 2.3. @behlendorf what do you think? |
Agreed. Let's keep these changes in two separate commits to make sure we don't break the ABI. We might have code which embeds a list_t in some public structure. Although on initial grep I don't see anything obvious. |
Currently vdev_queue_class_length is responsible for checking how long the queue length is, however, it doesn't check the length when a list is used, rather it just returns whether it is empty or not. To fix this I added a counter variable to vdev_queue_class to keep track of the sync IO ops, and changed vdev_queue_class_length to reference this variable instead. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: MigeljanImeri <[email protected]> Closes openzfs#15478
Currently vdev_queue_class_length is responsible for checking how long the queue length is, however, it doesn't check the length when a list is used, rather it just returns whether it is empty or not. To fix this I added a counter variable to vdev_queue_class to keep track of the sync IO ops, and changed vdev_queue_class_length to reference this variable instead. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: MigeljanImeri <[email protected]> Closes openzfs#15478
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR openzfs#15478. Signed-off-by: MigeljanImeri <[email protected]>
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR openzfs#15478. Signed-off-by: MigeljanImeri <[email protected]>
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR openzfs#15478. Signed-off-by: MigeljanImeri <[email protected]>
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR openzfs#15478. Signed-off-by: MigeljanImeri <[email protected]>
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR openzfs#15478. Signed-off-by: MigeljanImeri <[email protected]>
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR openzfs#15478. Signed-off-by: MigeljanImeri <[email protected]>
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR #15478. Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: MigeljanImeri <[email protected]> Closes #15812
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR openzfs#15478. Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: MigeljanImeri <[email protected]> Closes openzfs#15812
Removed the list_size struct member as it was only used in a single assertion, as mentioned in PR openzfs#15478. Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: MigeljanImeri <[email protected]> Closes openzfs#15812
Motivation and Context
Currently, when using zpool iostat, the pending sync IO operations are not shown properly, rather either a 1 or a 0 is displayed. This is due to
vdev_queue_class_length
checking whether the list is empty, rather then checking the length of the the list. This issue was noticed when doing performance evaluations with the O_DIRECT PR (#10018), as all IO's are issued with sync priority through the VDEV queues.Description
I added a counter variable to vdev_queue_t to keep track of the pending sync IO operations and changed
vdev_queue_class_length
to now reference this variable.How Has This Been Tested?
The changes were tested by using fio to generate sync IO operations. Without these changes the pending sync IO operations showed either 1 or 0, while with the changes the pending sync IO operations showed as expected.
Types of changes
Checklist:
Signed-off-by
.