-
Notifications
You must be signed in to change notification settings - Fork 63
[sled-agent] Add DumpDevice on M.2 as swap device #2859
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
base: main
Are you sure you want to change the base?
Conversation
| let zpool_name = | ||
| Self::initialize_zpool(&log, variant, &paths, &partitions)?; |
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.
This code is unchanged from before this PR, just refactored
| ensure_partition_layout(&log, &paths, unparsed_disk.variant)?; | ||
| let partitions = ensure_partition_layout(&log, &paths, variant)?; | ||
|
|
||
| Self::initialize_swap(&log, &paths, &partitions)?; |
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.
This call is new
| match paths.partition_device_path( | ||
| &partitions, | ||
| Partition::DumpDevice, | ||
| false, |
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.
Part of this is probably my own unfamiliarity with the sled-hardware code, but it might be good to explain why this is going in the DumpDevice partition?
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.
I've struggled to find a great summary for this in the illumos docs, but I'm really just trying to follow the convention for this which has been set there.
Reading a combination of
- https://illumos.org/man/8/dumpadm
- https://www.illumos.org/man/8/swap
- https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/swap/swap.c
I was able to infer:
- Apparently, it's common to use swap space as a dump device
- This is even the default mode of
swap -a-- if a swap device is added, and no dump devices exist, that swap device is used as a dump device.
I added a summary in 4039c7a
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, this was helpful.
sled-hardware/src/lib.rs
Outdated
| Ok(()) | ||
| } | ||
|
|
||
| // Initialize a swap within the ZfsPool partition. |
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.
"a swap device"?
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.
Also, I don't see where we do that here. Shouldn't there be a call to Swap::set_swap if that were true?
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.
good catch, this comment is totally wrong - fixed in 2e3533b
|
Before we move ahead with this I'd like us to consider a number of factors around serviceability and reliability and so on; e.g.,
If we decide we still need a swap device, we should consider an alternative strategy as well; viz., using a zvol on a U.2 device for swap. This has several potential benefits:
There are possibly other strategies to consider too. I don't think this is a slam dunk as-is, and I think we should do the research and design work before proceeding. |
DumpDevicepartition. As defined, these currently only exist within M.2 devices:omicron/sled-hardware/src/illumos/disk.rs
Lines 24 to 31 in a378cda
DumpDevicepartition is being used as swap space, using theswapcommand.Fixes #2858