[Letux-kernel] jz4730-i2c - clocksource

H. Nikolaus Schaller hns at goldelico.com
Sat Mar 6 16:22:50 CET 2021


latest code is now here:

https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/letux/jz4730-v9

> Am 06.03.2021 um 16:04 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
> Hi Paul,
> seems as if I can now also boot with clocksource=ingenic-timer without problems.
> 
> So avoiding regmap and using at least 26 bits (I also want to check 32 bit again)
> makes it work.
> 
> BTW: there is one more fix: I am resetting the Underrun flag in the interrupt
> handler. Maybe this prevents that the IRQ stays activated or is still active
> immediately if a new timer request is written. But I have not checked if this is
> really needed.
> 
>> Am 06.03.2021 um 12:03 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> 
>> 	sysbench --num-threads=1 --test=cpu --cpu-max-prime=1 run
> 
> I just had the idea to run this through strace :)
> 
> futex(0x777954f8, FUTEX_WAIT, 3116, NULL) = 0
> 
> can be seen on i.MX6 and on jz4730. But on jz4730 it takes ca. 15 seconds to succeed while i.MX6 it is not noticeable.
> 
> A little more specific:
> 
> i.MX6:
> 
> clock_gettime(CLOCK_REALTIME, {1615034730, 819353480}) = 0
> mmap2(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0xb6f81000
> mprotect(0xb6f81000, 4096, PROT_NONE)   = 0
> clone(child_stack=0xb6f87f88, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb6f884b8, tls=0xb6f88910, child_tidptr=0xb6f884b8) = 24026
> write(1, "Threads started!\n", 17Threads started!
> )      = 17
> futex(0xb6f884b8, FUTEX_WAIT, 24026, NULL) = 0
> setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}}, {it_interval={0, 0}, it_value={0, 0}}) = 0
> write(1, "Done.\n\n", 7Done.
> 
> )                = 7
> clock_gettime(CLOCK_REALTIME, {1615034730, 883641481}) = 0
> 
> jz4730:
> 
> clock_gettime(CLOCK_REALTIME, {1615035340, 801868585}) = 0
> mmap(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x76f96000
> mprotect(0x76f96000, 4096, PROT_NONE)   = 0
> clone(child_stack=0x77794ff0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x777954f8, tls=0x7779c920, child_tidptr=0x777954f8) = 3116
> write(1, "Threads started!\n", 17Threads started!
> )      = 17
> futex(0x777954f8, FUTEX_WAIT, 3116, NULL) = 0
> alarm(0)                                = 0
> write(1, "Done.\n\n", 7Done.
> 
> )                = 7
> clock_gettime(CLOCK_REALTIME, {1615035356, 871232080}) = 0
> 
> 
> What we can see is that ARM uses mmap2() and setitimer() while MIPS uses mmap() and alarm().
> Otherwise there is no visible difference - besides the 15 seconds delay of the futex.
> 
> This seems to be a new research project:
> a) what is the futex doing in sysbench (where is it hidden)?
> b) how is futex implemented on jz4730?
> c) why does it block that long?
> 
> Maybe this is also the reason why X11 is that slow.
> 
> BR,
> Nikolaus
> 



More information about the Letux-kernel mailing list