-
Notifications
You must be signed in to change notification settings - Fork 29
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
Rework CLI interface #263
Rework CLI interface #263
Conversation
Codecov Report
@@ Coverage Diff @@
## master #263 +/- ##
==========================================
- Coverage 64.15% 63.44% -0.71%
==========================================
Files 16 16
Lines 2427 2380 -47
==========================================
- Hits 1557 1510 -47
Misses 870 870
Continue to review full report at Codecov.
|
80b368c
to
246ba1c
Compare
7f10994
to
3167651
Compare
@mkroening @jbreitbart @jounathaen are missing on the list of authors. Why do we enable "Kernel Samepage Merging" on default? |
I rebased the PR and opened #277. We can discuss KSM with the rest of the CLI changes on friday, if you don't mind. :) |
277: Cargo.toml: Add authors r=stlankes a=mkroening I added `@mkroening,` `@jbreitbart` and `@jounathaen` as requested in #263 (comment). Co-authored-by: Martin Kröning <[email protected]>
I am on vacation :-) |
Ah, I see. Have a nice vacation then! :D Maybe I'll find some motivation in the next days to write some prose on all of these changes then. This PR should not be very urgent, right? |
These tests are obsolete once the guest memory minimum is enforced. Replacing these tests is tracked in hermit-os#265.
82e75e2
to
fbbeecb
Compare
I expanded the commit messages. See those for details on each commit. Regarding turning on KSM by default: As far as I know this matches QEMU's default behavior. Also as KSM has been designed especially for hypervisors, I see no reason not to enable KSM by default. Our |
It takes time... For large VMs is this useful. For small binaries with small memory footprints, I would say, this is just overhead with nearly no benefit. But this is more my feeling.... |
Now if only someone would have added a way to benchmark functionality 😜 |
Very good point. I'll be doing some benchmarks then. :D |
@stlankes, I did some benchmarks and further investigation into KSM. The KSM daemon is disabled by default. Without having activated the KSM daemon, no overhead is measurable. In that case, the kernel only registers the memory range for whenever the KSM daemon is started in the future. Activating the KSM daemon had no effect on Since the KSM daemon has to be enabled explicitly system-wide before having any effect, us advising KSM regions is a sensible default in my opinion. The user could still opt-out application-wise via What do you think? |
I'll compare the default KSM setting with Firecracker and QEMU's microvm. |
* Have structs for args to modularize arg handling * Improve argument docs * Improve error messages on faulty args * Colorize help output * Rename `--disable-hugepages` to `--no-thp` * Corresponds to QEMU's `-redhat-disable-THP` * Remove `HERMIT_HUGEPAGES` * Replace `--mergeable` with `--ksm` * Corresponds to QEMU's `-redhat-disable-KSM` * Remove `HERMIT_MERGEABLE` * Remove `HERMIT_VERBOSE` * Rename `-c, --cpus` to `-c, --cpu-count` * Rename `HERMIT_CPUS` to `HERMIT_CPU_COUNT` * Rename `-s, --gdb_port` to `-s, --gdb-port` * Rename `-m, --memsize` to `-m, --memory-size` * Rename `HERMIT_MEM` to `HERMIT_MEMORY_SIZE` * Disable `--nic` since networking is currently not supported ``` uhyve 0.0.29 Stefan Lankes <[email protected]>, Martin Kröning <[email protected]>, Jens Breitbart <[email protected]>, Jonathan Klimt <[email protected]> A minimal hypervisor for RustyHermit USAGE: uhyve [OPTIONS] <KERNEL> [KERNEL_ARGS]... ARGS: <KERNEL> The kernel to execute <KERNEL_ARGS>... Arguments to forward to the kernel OPTIONS: -h, --help Print help information -s, --gdb-port <GDB_PORT> GDB server port Starts a GDB server on the provided port and waits for a connection. [env: HERMIT_GDB_PORT=] -v, --verbose Print kernel messages -V, --version Print version information MEMORY: --ksm Kernel Samepage Merging Advise the kernel to enable Kernel Samepage Merging [KSM] on the virtual RAM. [KSM]: https://www.kernel.org/doc/html/latest/admin-guide/mm/ksm.html -m, --memory-size <MEMORY_SIZE> Guest RAM size [env: HERMIT_MEMORY_SIZE=] [default: "64.00 MiB"] --no-thp No Transparent Hugepages Don't advise the kernel to enable Transparent Hugepages [THP] on the virtual RAM. [THP]: https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html CPU: -a, --affinity <CPUs> Bind guest vCPUs to host cpus A list of host CPU numbers onto which the guest vCPUs should be bound to obtain performance benefits. List items may be single numbers or inclusive ranges. List items may be separated with commas or spaces. # Examples * `--affinity "0 1 2"` * `--affinity 0-1,2` -c, --cpu-count <CPU_COUNT> Number of guest CPUs [env: HERMIT_CPU_COUNT=] [default: 1] ``` ``` uhyve 0.0.29 Stefan Lankes <[email protected]> Martin Kröning <[email protected]> Jens Breitbart <[email protected]> Jonathan Klimt <[email protected]> USAGE: uhyve [FLAGS] [OPTIONS] <KERNEL> [ARGUMENTS]... FLAGS: --disable-hugepages Disable the usage of huge pages --mergeable Enable kernel feature to merge same pages -v, --verbose Print also kernel messages -h, --help Prints help information -V, --version Prints version information OPTIONS: -c, --cpus <CPUS> Number of guest processors [env: HERMIT_CPUS=] -a, --affinity <cpulist> A list of CPUs delimited by commas onto which the virtual CPUs should be bound. This may improve performance. -s, --gdb_port <GDB_PORT> Enables GDB-Stub on given port [env: HERMIT_GDB_PORT=] -m, --memsize <MEM> Memory size of the guest [env: HERMIT_MEM=] --nic <NETIF> Name of the network interface [env: HERMIT_NETIF=] ARGS: <KERNEL> Sets path to the kernel <ARGUMENTS>... Arguments of the unikernel ```
This improves constructing Uhyve instances programmatically.
This disables GDB and network parameters on macos.
This allows supplying kernel arguments programatically and unifies argument parsing in the frontend using clap. This avoids parsing kernel arguments from the environment unconditionally.
I disabled KSM per default. |
bors r+ |
Build succeeded: |
Reopens #243, which was closed accidentally.
This heavily reworks the CLI interface using StructOpt as well as
Params
for creating uhyve instances programmatically.See the commit messages for details.