You are not logged in.

#1 2013-09-02 02:17:49

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Dealing with slow gettimeofday() calls

On my netbook, getimeofday() is very slow for some reason - e.g. calls to it take up 45% of Firefox's time spent on system calls, vs. 9% on my old Acer laptop. This has a pretty severe impact on interactivity in some programs.

Does anyone know what the hardware origin of this is, and if there are any workarounds for Linux?

Offline

#2 2013-09-02 02:25:41

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Dealing with slow gettimeofday() calls

$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource

$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc acpi_pm

echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource

tsc is fastest, hpet is slowest, acpi_pm is reasonable.

However, for tsc, I use the kernel command-line option:  processor.max_cstate=1

Offline

#3 2013-09-02 02:44:36

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Dealing with slow gettimeofday() calls

Thanks. I tried using acpi_pm and tsc (the latter required idle=poll as well), but neither made any noticable difference. Also tried turning of cpu frequency scaling... Again, no change.

Edit: I will note though that acpi_pm improved the netbook's predicted battery life by about an hour.

Last edited by Gullible Jones (2013-09-02 03:14:18)

Offline

Board footer

Powered by FluxBB