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

virtme-configkernel: disable nvram support #155

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Conversation

arighi
Copy link
Owner

@arighi arighi commented Aug 27, 2024

We don't need to enable nvram support by default in the guest and having this disabled can save a few millisec during boot.

We don't need to enable nvram support by default in the guest and having
this disabled can save a few millisec during boot.

Signed-off-by: Andrea Righi <[email protected]>
Copy link
Collaborator

@matttbe matttbe left a comment

Choose a reason for hiding this comment

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

Good idea!

To accelerate the build, I also disable some options: I added a few a long time ago, also because we don't need sound, or DRM. But I don't think people using virtme needs LED drivers for example :)

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker/blob/da60c60ccec923fde7c7e31dd07ea8ce2c2e6ba7/entrypoint.sh#L462-L466

@matttbe
Copy link
Collaborator

matttbe commented Aug 27, 2024

Without NVRAM, it now takes 0.5 second to boot on my side!

[    0.233247] Run /usr/local/lib/python3.12/dist-packages/virtme/guest/bin/virtme-ng-init as init process
(...)
[    0.239021] virtme-ng-init: mount devtmpfs -> /dev: EBUSY: Device or resource busy
[    0.324961] systemd-tmpfile (53) used greatest stack depth: 13280 bytes left
[    0.330561] ip (55) used greatest stack depth: 12968 bytes left
[    0.330941] virtme-ng-init: setting up network device eth0
[    0.334850] virtme-ng-init: Starting systemd-udevd version 255.4-1ubuntu8.4
[    0.334931] virtme-ng-init: triggering udev coldplug
[    0.364034] ip (63) used greatest stack depth: 12792 bytes left
[    0.386586] virtme-ng-init: waiting for udev to settle
[    0.476824] virtme-ng-init: udhcpc: started, v1.36.1
[    0.476824] udhcpc: broadcasting discover
[    0.476824] udhcpc: broadcasting select for 10.0.2.15, server 10.0.2.2
[    0.476824] udhcpc: lease of 10.0.2.15 obtained from 10.0.2.2, lease time 86400
[    0.504215] virtme-ng-init: udev is done
[    0.507673] virtme-ng-init: initialization done

1/4 of second to reach the init script!

EDIT: And without --net, it is under 0.5 second:

[    0.426374] virtme-ng-init: initialization done

matttbe added a commit to multipath-tcp/mptcp-upstream-virtme-docker that referenced this pull request Aug 27, 2024
And compilation time.

See: arighi/virtme-ng#155
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
@arighi
Copy link
Owner Author

arighi commented Aug 27, 2024

Good idea!

To accelerate the build, I also disable some options: I added a few a long time ago, also because we don't need sound, or DRM. But I don't think people using virtme needs LED drivers for example :)

At some point we should do a review of the default configs, but don't underestimate how people are using virtme-ng. 😄

There are people using it to test GUIs or even webcams... and we have --sound and --graphics, so we need to keep sound and drm enabled by default. Maybe we should consider to have a --config-minimal, but at the end things like sound/drm don't impact much on boot time, and I think it's more important to make this part fast.

@arighi
Copy link
Owner Author

arighi commented Aug 27, 2024

Without NVRAM, it now takes 0.5 second to boot on my side!

[    0.233247] Run /usr/local/lib/python3.12/dist-packages/virtme/guest/bin/virtme-ng-init as init process
(...)
[    0.239021] virtme-ng-init: mount devtmpfs -> /dev: EBUSY: Device or resource busy
[    0.324961] systemd-tmpfile (53) used greatest stack depth: 13280 bytes left
[    0.330561] ip (55) used greatest stack depth: 12968 bytes left
[    0.330941] virtme-ng-init: setting up network device eth0
[    0.334850] virtme-ng-init: Starting systemd-udevd version 255.4-1ubuntu8.4
[    0.334931] virtme-ng-init: triggering udev coldplug
[    0.364034] ip (63) used greatest stack depth: 12792 bytes left
[    0.386586] virtme-ng-init: waiting for udev to settle
[    0.476824] virtme-ng-init: udhcpc: started, v1.36.1
[    0.476824] udhcpc: broadcasting discover
[    0.476824] udhcpc: broadcasting select for 10.0.2.15, server 10.0.2.2
[    0.476824] udhcpc: lease of 10.0.2.15 obtained from 10.0.2.2, lease time 86400
[    0.504215] virtme-ng-init: udev is done
[    0.507673] virtme-ng-init: initialization done

1/4 of second to reach the init script!

EDIT: And without --net, it is under 0.5 second:

[    0.426374] virtme-ng-init: initialization done

Without NVRAM, it now takes 0.5 second to boot on my side!

[    0.233247] Run /usr/local/lib/python3.12/dist-packages/virtme/guest/bin/virtme-ng-init as init process
(...)
[    0.239021] virtme-ng-init: mount devtmpfs -> /dev: EBUSY: Device or resource busy
[    0.324961] systemd-tmpfile (53) used greatest stack depth: 13280 bytes left
[    0.330561] ip (55) used greatest stack depth: 12968 bytes left
[    0.330941] virtme-ng-init: setting up network device eth0
[    0.334850] virtme-ng-init: Starting systemd-udevd version 255.4-1ubuntu8.4
[    0.334931] virtme-ng-init: triggering udev coldplug
[    0.364034] ip (63) used greatest stack depth: 12792 bytes left
[    0.386586] virtme-ng-init: waiting for udev to settle
[    0.476824] virtme-ng-init: udhcpc: started, v1.36.1
[    0.476824] udhcpc: broadcasting discover
[    0.476824] udhcpc: broadcasting select for 10.0.2.15, server 10.0.2.2
[    0.476824] udhcpc: lease of 10.0.2.15 obtained from 10.0.2.2, lease time 86400
[    0.504215] virtme-ng-init: udev is done
[    0.507673] virtme-ng-init: initialization done

1/4 of second to reach the init script!

EDIT: And without --net, it is under 0.5 second:

[    0.426374] virtme-ng-init: initialization done

Very nice! How about time vng -- uname -r?

@arighi arighi merged commit 6ace291 into main Aug 27, 2024
8 checks passed
@matttbe
Copy link
Collaborator

matttbe commented Sep 6, 2024

(With a bit of delay)

Very nice! How about time vng -- uname -r?

Around one second, not bad!

$ cd <kernel build dir>
$ time vng -- uname -r
6.11.0-rc5+
vng -- uname -r  1.17s user 1.43s system 203% cpu 1.281 total

@arighi
Copy link
Owner Author

arighi commented Sep 6, 2024

Nice! Thanks! :)

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.

2 participants