marcofaltelli / Metronome

Metronome: adaptive and precise intermittent packet retrieval in DPDK
MIT License
13 stars 2 forks source link

hr_sleep not working anymore #3

Closed tbarbette closed 1 day ago

tbarbette commented 1 month ago

Hi all,

I used hr_sleep in the past, but it seems the syscall does not work anymore. It might be due to a microcode update because I think the kernel version did not change. It looks like the syscall itself is kind of ignored.

Dmesg:

[ 5278.108277] HR_SLEEP: initializing
[ 5278.143727] HR_SLEEP: syscall table found at ffffffffb9a00320
[ 5278.143733] HR_SLEEP: found sys_ni_syscall entry at syscall_table[134]
[ 5278.143735] HR_SLEEP: found sys_ni_syscall entry at syscall_table[156]
[ 5278.143736] HR_SLEEP: found sys_ni_syscall entry at syscall_table[174]
[ 5278.143737] HR_SLEEP: found sys_ni_syscall entry at syscall_table[177]
[ 5278.143737] HR_SLEEP: found sys_ni_syscall entry at syscall_table[178]
[ 5278.143738] HR_SLEEP: found sys_ni_syscall entry at syscall_table[180]
[ 5278.143739] HR_SLEEP: found sys_ni_syscall entry at syscall_table[181]
[ 5278.143740] HR_SLEEP: found sys_ni_syscall entry at syscall_table[182]
[ 5278.143740] HR_SLEEP: found sys_ni_syscall entry at syscall_table[183]
[ 5278.143741] HR_SLEEP: found sys_ni_syscall entry at syscall_table[184]
[ 5278.143742] HR_SLEEP: getting entry 134
[ 5278.143743] HR_SLEEP: module correctly mounted
[ 5278.143743] V2

V2 is a message in the init added by myself.

sudo ./nanosleep-user 134 1000000
expected number of clock cycles per 1000000 nanoseconds timeout is 2400000
hr_sleep average sleep cycles:  360
nanosleep average sleep cycles: 3225777

I looked at dmesg, and I also added a message as the first line of the syscall and I can't see it.

Any idea?

marcofaltelli commented 1 month ago

Hi, which kernel version are you using? In the meantime, you can use Metronome with the -m 0 parameter. This uses nanosleep with the prctl(PR_SET_TIMERSLACK, 1); setup function. This gives performances very close to the hr_sleep syscall

tbarbette commented 1 month ago
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"

Linux elrond 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

I see I have unattended upgrade, and on another machine it worked, I reboot and it didn't so it might be a silent kernel upgrade.