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

consider defaulting the clock source for EC2 instances #3881

Open
tzneal opened this issue Apr 9, 2024 · 1 comment
Open

consider defaulting the clock source for EC2 instances #3881

tzneal opened this issue Apr 9, 2024 · 1 comment
Assignees
Labels
area/core Issues core to the OS (variant independent) status/research This issue is being researched type/enhancement New feature or request

Comments

@tzneal
Copy link
Contributor

tzneal commented Apr 9, 2024

What I'd like:

I would like the clock source (/sys/devices/system/clocksource/clocksource0/current_clocksource) to be defaulted on boot per the guidance at https://repost.aws/knowledge-center/manage-ec2-linux-clock-source

Any alternatives you've considered:

@tzneal tzneal added status/needs-triage Pending triage or re-evaluation type/enhancement New feature or request labels Apr 9, 2024
@bcressey
Copy link
Contributor

bcressey commented Apr 9, 2024

My initial implementation idea is to have a pair of systemd units.

# ec2-nitro-clocksource.service
[Unit]
Description=Set Preferred Clock Source (Nitro)
DefaultDependencies=no
ConditionVirtualization=amazon

[Service]
Type=oneshot
ExecStart=/usr/bin/echo kvm-clock
RemainAfterExit=true
StandardOutput=file:/sys/devices/system/clocksource/clocksource0/current_clocksource

[Install]
WantedBy=sysinit.target
# ec2-xen-clocksource.service
[Unit]
Description=Set Preferred Clock Source (Xen)
DefaultDependencies=no
ConditionVirtualization=xen
ConditionCPUFeature=constant_tsc

[Service]
Type=oneshot
ExecStart=/usr/bin/echo tsc
RemainAfterExit=true
StandardOutput=file:/sys/devices/system/clocksource/clocksource0/current_clocksource

[Install]
WantedBy=sysinit.target

I need to make sure that the Xen unit does the right thing for the older instance types with an emulated TSC timer. Also, I believe the feature we actually want to test for is "invariant_tsc" or "nonstop_tsc" instead of just "constant_tsc", which may require a systemd patch.

@bcressey bcressey self-assigned this Apr 9, 2024
@bcressey bcressey added status/research This issue is being researched area/core Issues core to the OS (variant independent) and removed status/needs-triage Pending triage or re-evaluation labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues core to the OS (variant independent) status/research This issue is being researched type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants