We have moved to a new Sailfish OS Forum. Please start new discussions there.
8

Clock shift with high CPU load

asked 2015-07-09 08:30:37 +0300

V10lator gravatar image

updated 2015-07-09 08:34:01 +0300

This happens mostly when I'm compiling something: The system clock shifts. After compiling the kernel sources it's half an hour to an hour in the past, for example.

//EDIT: BTW: This goes so far that while compiling the kernel sources there are a lot of warnings about files with timestamps in the future.

//EDIT²: But not only compiling does show that. Also heavy (android) gaming or other CPU intensive apps (slowly) shift the clock.

edit retag flag offensive close delete

Comments

Maybe something like chrony could be used to keep keep a watch over the clock drift ?

MartinK ( 2015-07-09 19:27:27 +0300 )edit

possible explantion to this problem with clock drift => https://together.jolla.com/question/72043/11627-android-clockwork-time-seems-to-run-too-fast/

Kari ( 2015-07-09 22:04:03 +0300 )edit

@Kari Well, this problem is exactly the opposite of what's written in your linked thread. They complain about the android clock shifting forwards while I'm complaining about the native system clock shifting backwards. Also my problem is completely unrelated to Aliendalvik while a restart of it seems to be a workaround for them.

As I'm talking about the native system clock even a full system reboot doesn't fix the time (but syncs it to hw clock on shutdown?).

V10lator ( 2015-07-10 12:51:03 +0300 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2015-07-12 23:16:30 +0300

Claudio Maradonna gravatar image

Maybe the CPU thread that update clock, is blocked due to compilation. Check if memory is filled. If filled, maybe Sailfish block process and there is no resync with hardware so clock is asynced.

edit flag offensive delete publish link more

Comments

It just happened again while compiling kernel:

make[2]: Warning: File `sound/soc/msm/built-in.o' has modification time 67 s in the future
  LD      sound/soc/snd-soc-core.o
  CC      fs/jbd/commit.o
  LD      sound/soc/built-in.o
make[2]: Warnung: Mit der Uhr stimmt etwas nicht. 
Die Bearbeitung könnte unvollständig sein.
make[1]: Warning: File `sound/soc/built-in.o' has modification time 67 s in the future

Memory:

$ free
             total       used       free     shared    buffers     cached
Mem:        828696     801012      27684          0         56     178680
-/+ buffers/cache:     622276     206420
Swap:      1676480     136928    1539552

Anyway, the CPU should never be able to block the clock I think? At least I never saw something like this before on other hardware. Isn't a busy CPU exactly why a clock source exists (like hpet/tsc on desktop) ?

I see the Jolla Smartphone using "gp timer". Google tells this is a "general purpose timer" and most likely builded into the SoC. Anyway, there should be other timers available, like from the watchdog or, according to kernel docs, from the CPU:

        clocksource=    Override the default clocksource
                        Format: <string>
                        Override the default clocksource and use the clocksource
                        with the name specified.
                        Some clocksource names to choose from, depending on
                        the platform:
                        [all] jiffies (this is the base, fallback clocksource)
                        [ACPI] acpi_pm
                        [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2,
                                pxa_timer,timer3,32k_counter,timer0_1
                        [AVR32] avr32
                        [X86-32] pit,hpet,tsc;
                                scx200_hrt on Geode; cyclone on IBM x440
                        [MIPS] MIPS
                        [PARISC] cr16
                        [S390] tod
                        [SH] SuperH
                        [SPARC64] tick
                        [X86-64] hpet,tsc</string>

So I would love to test other clock sources but don't know how to change kernel command line. Does anyone know? I really need this fixed ASAP.

//EDIT:

# cat /sys/devices/system/clocksource/clocksource0/available_clocksource 
gp_timer dg_timer
# echo dg_timer > /sys/devices/system/clocksource/clocksource0/current_clocksource

And the system crashes. So we have one clock source crashing the device and another one not being accurate. Now where are imx_timer1, OSTS, netx_timer, mpu_timer2, pxa_timer, timer3, 32k_counter and timer0_1 ? And, even more important: How to fix the clock?

//EDIT²: If that matters: With dg_timer the system doesn't crash immidiately. The UI freezes immediately but by switching the clocksource back (via ssh) it unfreezes again. I guess the real crash happens when the watchdog kicks in cause everything is frozen.

//EDIT³: "Now where are imx_timer1, OSTS, netx_timer, mpu_timer2, pxa_timer, timer3, 32k_counter and timer0_1" - To answer my own question: Not enabled in kernel config: # CONFIG_ARM_ARCH_TIMER is not set. So no way to fix without recompiling kernel, which is on my todo list but fixing clock has way higher priority... Kind of chicken-egg problem now... Help?

V10lator ( 2015-07-16 08:02:14 +0300 )edit

compilation flags and parameters??

Claudio Maradonna ( 2015-07-17 01:55:46 +0300 )edit

@Claudio Maradonna 3 threads (make -j3) and compilation flags... Whatever the default Jolla kernel uses. Anyhow, that doesn't really matter. Kernel compilation is just a good way to trigger this bug but there are others (android gaming and basically everything with high CPU load).

//EDIT: Experiencing this bug on 1.1.6.27 and 1.1.7.24 - older versions untested.

V10lator ( 2015-07-17 10:21:36 +0300 )edit
Login/Signup to Answer

Question tools

Follow
5 followers

Stats

Asked: 2015-07-09 08:30:37 +0300

Seen: 425 times

Last updated: Jul 12 '15