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

Set "none" scheduler if available (initramfs) #9042

Merged
merged 1 commit into from
Aug 19, 2019
Merged

Set "none" scheduler if available (initramfs) #9042

merged 1 commit into from
Aug 19, 2019

Conversation

colmbuckley
Copy link
Contributor

@colmbuckley colmbuckley commented Jul 16, 2019

Existing zfs initramfs script logic will attempt to set the 'noop' scheduler if it's available on the vdev block devices. Newer kernels have the similar 'none' scheduler on multiqueue devices; this change alters the initramfs script logic to also attempt to set this scheduler.

Motivation and Context

Description

How Has This Been Tested?

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)
  • Documentation (a change to man pages or other documentation)

Checklist:

@ghfields
Copy link
Contributor

I almost tackled this in #8004 but held back since there did not seem to be a consensus about the proper setting for mq devices.

Also check #8427 and its abandoned #8436 pull for Dracut.

I'm not exactly sure of what I am proposing, except to make sure all known efforts are aligned.

@richardelling
Copy link
Contributor

I vote for removing scheduler changes from ZFS entirely. It is a problem better solved by OS installer.

@colmbuckley
Copy link
Contributor Author

I vote for removing scheduler changes from ZFS entirely. It is a problem better solved by OS installer.

I fully agree. A note in the installation/system recommendations documentation would probably suffice. It's still not really clear to me why the simple schedulers are preferred; if the ZFS code also uses explicit synchronisation mechanisms.

@codecov
Copy link

codecov bot commented Jul 16, 2019

Codecov Report

Merging #9042 into master will decrease coverage by 0.31%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9042      +/-   ##
==========================================
- Coverage   79.31%   78.99%   -0.32%     
==========================================
  Files         400      400              
  Lines      121942   121653     -289     
==========================================
- Hits        96716    96098     -618     
- Misses      25226    25555     +329
Flag Coverage Δ
#kernel 79.65% <ø> (-0.2%) ⬇️
#user 66.59% <ø> (-0.5%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f09fda5...320813b. Read the comment docs.

@behlendorf behlendorf added the Status: Design Review Needed Architecture or design is under discussion label Jul 16, 2019
@behlendorf
Copy link
Contributor

I vote for removing scheduler changes from ZFS entirely. It is a problem better solved by OS installer.

I'm inclined to agree, this behavior was originally added solely as convenience since at the time the kernel provided an easy mechanism to set this. That hasn't been the case since the 4.12 kernel.

@behlendorf behlendorf requested a review from rlaager July 18, 2019 23:51
Copy link
Member

@rlaager rlaager left a comment

Choose a reason for hiding this comment

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

  1. The comment above the changed code says "elevator=noop". That should probably be adjusted in some way. For example, "Set the elevator to noop/none on the root pool's vdevs' disks. ZFS already". You'll probably need to re-wrap it as it's getting longer.
  2. shellcheck is complaining about the while read i which it wants to be while read -r i. The latter seems to work. Maybe we should fix that here? I realize that's not new (and is my fault, as I think I wrote this originally).

@colmbuckley
Copy link
Contributor Author

Before we get into the weeds of defensive shell programming; what are general thoughts about removing this stanza completely and not attempting to set the scheduler in initramfs? I'm more inclined to leave this up to individual systems administrators, or maybe print a warning here if the enclosing devices are using a scheduler we don't trust?

@rlaager
Copy link
Member

rlaager commented Jul 21, 2019

If the proposal is for this to be entirely removed from ZFS (i.e. ZFS will not set none / noop on wholedisk vdevs), I'm on the fence. If the proposal is to remove it from only the initramfs, I am opposed, as that makes things inconsistent for root-on-ZFS installs.

@colmbuckley
Copy link
Contributor Author

If the proposal is for this to be entirely removed from ZFS (i.e. ZFS will not set none / noop on wholedisk vdevs), I'm on the fence. If the proposal is to remove it from only the initramfs, I am opposed, as that makes things inconsistent for root-on-ZFS installs.

Fair enough; that deserves a more thorough design review. In the meantime, implemented the changes you suggest; PTAL.

Copy link
Member

@rlaager rlaager left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Looks good. But would you mind rebasing this on the latest master and force updating the PR.

@behlendorf behlendorf added Status: Code Review Needed Ready for review and testing and removed Status: Design Review Needed Architecture or design is under discussion labels Jul 30, 2019
@colmbuckley
Copy link
Contributor Author

Rebase pushed. I think the commit message from 42c24d9 is sufficient for the whole merge.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Aug 15, 2019
@behlendorf
Copy link
Contributor

@colmbuckley it looks like this wasn't rebased. Would you mind doing it one more time and force updating the PR. Please also add your signed-off-by to the comment message (git commit --amend -s), and then I'll go ahead and get this merged.

Existing zfs initramfs script logic will attempt to set the 'noop' scheduler if it's available on the vdev block devices. Newer kernels have the similar 'none' scheduler on multiqueue devices; this change alters the initramfs script logic to also attempt to set this scheduler if it's available.

Signed-off-by: Colm Buckley <colm@tuatha.org>
@colmbuckley
Copy link
Contributor Author

@colmbuckley it looks like this wasn't rebased. Would you mind doing it one more time [...]

Sorry, my git-fu is weak. Done, I think, PTAL.

Copy link
Contributor

@ghfields ghfields left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks.

@behlendorf behlendorf merged commit f6fbe25 into openzfs:master Aug 19, 2019
@colmbuckley colmbuckley deleted the patch-1 branch August 22, 2019 04:02
@behlendorf behlendorf mentioned this pull request Sep 5, 2019
12 tasks
@colmbuckley
Copy link
Contributor Author

Didn't make 0.8.2? Bah.

tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 24, 2019
Existing zfs initramfs script logic will attempt to set the 'noop'
scheduler if it's available on the vdev block devices. Newer kernels
have the similar 'none' scheduler on multiqueue devices; this change
alters the initramfs script logic to also attempt to set this scheduler
if it's available.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Garrett Fields <ghfields@gmail.com>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Colm Buckley <colm@tuatha.org>
Closes openzfs#9042
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 27, 2019
Existing zfs initramfs script logic will attempt to set the 'noop'
scheduler if it's available on the vdev block devices. Newer kernels
have the similar 'none' scheduler on multiqueue devices; this change
alters the initramfs script logic to also attempt to set this scheduler
if it's available.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Garrett Fields <ghfields@gmail.com>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Colm Buckley <colm@tuatha.org>
Closes openzfs#9042
tonyhutter pushed a commit that referenced this pull request Jan 23, 2020
Existing zfs initramfs script logic will attempt to set the 'noop'
scheduler if it's available on the vdev block devices. Newer kernels
have the similar 'none' scheduler on multiqueue devices; this change
alters the initramfs script logic to also attempt to set this scheduler
if it's available.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Garrett Fields <ghfields@gmail.com>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Colm Buckley <colm@tuatha.org>
Closes #9042
allanjude pushed a commit to KlaraSystems/zfs that referenced this pull request Apr 28, 2020
Existing zfs initramfs script logic will attempt to set the 'noop'
scheduler if it's available on the vdev block devices. Newer kernels
have the similar 'none' scheduler on multiqueue devices; this change
alters the initramfs script logic to also attempt to set this scheduler
if it's available.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Garrett Fields <ghfields@gmail.com>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Colm Buckley <colm@tuatha.org>
Closes openzfs#9042
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this pull request Apr 3, 2021
This effectively reverts
  4fc411f (part of openzfs#6807) and
  f6fbe25 (openzfs#9042) ‒
the code itself and latter PR cite symmetry with whole-disk-vdev
behaviour (presumably because rootfs vdevs are rarely whole disks),
but the code is broken for NVME devices (indeed, it'd strip the
controller number instead of the (potential) partition number, turning
"nvme0n1p1" into "nvmen1p1", which would then subsequently fail the
sysfs existence check); it could be fixed to handle those (and any
others) rather easily by dereferencing /sys/class/block/$devname,
but this isn't the place for setting this ‒ as noted in the commit that
removed setting the scheduler by default
(9e17e6f) ‒ use an udev rule

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
behlendorf pushed a commit that referenced this pull request Apr 7, 2021
This effectively reverts
  4fc411f (part of #6807) and
  f6fbe25 (#9042) ‒
the code itself and latter PR cite symmetry with whole-disk-vdev
behaviour (presumably because rootfs vdevs are rarely whole disks),
but the code is broken for NVME devices (indeed, it'd strip the
controller number instead of the (potential) partition number, turning
"nvme0n1p1" into "nvmen1p1", which would then subsequently fail the
sysfs existence check); it could be fixed to handle those (and any
others) rather easily by dereferencing /sys/class/block/$devname,
but this isn't the place for setting this ‒ as noted in the commit that
removed setting the scheduler by default
(9e17e6f) ‒ use an udev rule

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11838
behlendorf pushed a commit that referenced this pull request Apr 7, 2021
This effectively reverts
  4fc411f (part of #6807) and
  f6fbe25 (#9042) ‒
the code itself and latter PR cite symmetry with whole-disk-vdev
behaviour (presumably because rootfs vdevs are rarely whole disks),
but the code is broken for NVME devices (indeed, it'd strip the
controller number instead of the (potential) partition number, turning
"nvme0n1p1" into "nvmen1p1", which would then subsequently fail the
sysfs existence check); it could be fixed to handle those (and any
others) rather easily by dereferencing /sys/class/block/$devname,
but this isn't the place for setting this ‒ as noted in the commit that
removed setting the scheduler by default
(9e17e6f) ‒ use an udev rule

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11838
mcmilk pushed a commit to mcmilk/zfs that referenced this pull request Apr 9, 2021
This effectively reverts
  4fc411f (part of openzfs#6807) and
  f6fbe25 (openzfs#9042) ‒
the code itself and latter PR cite symmetry with whole-disk-vdev
behaviour (presumably because rootfs vdevs are rarely whole disks),
but the code is broken for NVME devices (indeed, it'd strip the
controller number instead of the (potential) partition number, turning
"nvme0n1p1" into "nvmen1p1", which would then subsequently fail the
sysfs existence check); it could be fixed to handle those (and any
others) rather easily by dereferencing /sys/class/block/$devname,
but this isn't the place for setting this ‒ as noted in the commit that
removed setting the scheduler by default
(9e17e6f) ‒ use an udev rule

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#11838
mcmilk pushed a commit to mcmilk/zfs that referenced this pull request Apr 9, 2021
This effectively reverts
  4fc411f (part of openzfs#6807) and
  f6fbe25 (openzfs#9042) ‒
the code itself and latter PR cite symmetry with whole-disk-vdev
behaviour (presumably because rootfs vdevs are rarely whole disks),
but the code is broken for NVME devices (indeed, it'd strip the
controller number instead of the (potential) partition number, turning
"nvme0n1p1" into "nvmen1p1", which would then subsequently fail the
sysfs existence check); it could be fixed to handle those (and any
others) rather easily by dereferencing /sys/class/block/$devname,
but this isn't the place for setting this ‒ as noted in the commit that
removed setting the scheduler by default
(9e17e6f) ‒ use an udev rule

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#11838
adamdmoss pushed a commit to adamdmoss/zfs that referenced this pull request Apr 10, 2021
This effectively reverts
  4fc411f (part of openzfs#6807) and
  f6fbe25 (openzfs#9042) ‒
the code itself and latter PR cite symmetry with whole-disk-vdev
behaviour (presumably because rootfs vdevs are rarely whole disks),
but the code is broken for NVME devices (indeed, it'd strip the
controller number instead of the (potential) partition number, turning
"nvme0n1p1" into "nvmen1p1", which would then subsequently fail the
sysfs existence check); it could be fixed to handle those (and any
others) rather easily by dereferencing /sys/class/block/$devname,
but this isn't the place for setting this ‒ as noted in the commit that
removed setting the scheduler by default
(9e17e6f) ‒ use an udev rule

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#11838
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
This effectively reverts
  4fc411f (part of openzfs#6807) and
  f6fbe25 (openzfs#9042) ‒
the code itself and latter PR cite symmetry with whole-disk-vdev
behaviour (presumably because rootfs vdevs are rarely whole disks),
but the code is broken for NVME devices (indeed, it'd strip the
controller number instead of the (potential) partition number, turning
"nvme0n1p1" into "nvmen1p1", which would then subsequently fail the
sysfs existence check); it could be fixed to handle those (and any
others) rather easily by dereferencing /sys/class/block/$devname,
but this isn't the place for setting this ‒ as noted in the commit that
removed setting the scheduler by default
(9e17e6f) ‒ use an udev rule

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#11838
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