[PATCH] Dyn-tick support for S3C24xx (hack).
andrzej zaborowski
balrogg at gmail.com
Mon Jun 30 05:54:57 CEST 2008
Yesterday I played with Intel's powertop on the Neo and noticed we
generate 300+ wake-ups per second. It told me to enable CONFIG_NO_HZ
for better results, so I went there and it was enabled
(CONFIG_NO_IDLE_HZ on ARM), but it turns out the option doesn't do
anything except on the OMAPs and Intel Xscale (and x86). I then tried
to implement dyn-tick support for arch/arm/plat-s3c24xx/time.c (and do
some clean-up) but soon learnt why it wasn't supported. The S3C timers
are 16bit, plus there's a serious shortage of them compared to OMAP.
So I did implement it and it reduces the wake-ups considerably but
because of the added calculations it needed I'm not sure if it's good
or bad for battery life, someone would have to check that. I know on
OMAP this brings a huge saving, but the s3c's idle states probably
don't do much.
dyn-ticks on ARM is enabled by passing "dyntick=enable" in the boot
parameters or running
# echo 1 > /sys/devices/system/timer/timer0/dyn_tick
(also lets you switch back to HZ mode later).
Beside battery life, I suspect it's bad for time-keeping precision,
but the difference shouldn't be more than 1% because my test would
notice that. It may also crash but in the current form hasn't crashed
for me yet. I had it running for 12h 50m straight until the battery
died (yes! almost 13h on battery, with CPU & modem & whatnot powered
on).
======= X, OM2007.2, dyn-tick disabled =======
PowerTOP 1.11 (C) 2007, 2008 Intel Corporation
Collecting data for 15 seconds
< Detailed C-state information is not available.>
P-states (frequencies)
Wakeups-from-idle per second : 308.4 interval: 15.0s
no ACPI power usage estimate available
Top causes for wakeups:
64.9% (200.0) <interrupt> : S3C2410 Timer Tick
33.4% (102.9) <interrupt> : lis302dl
0.3% ( 1.0) matchbox-window : schedule_timeout (process_timeout)
0.3% ( 0.8) <interrupt> : s3c2440-i2c
0.2% ( 0.7) Xglamo : do_setitimer (it_real_fn)
0.2% ( 0.5) <kernel core> : queue_delayed_work_on
(delayed_work_timer_fn)
0.2% ( 0.5) pulseaudio : schedule_timeout (process_timeout)
0.1% ( 0.4) <interrupt> : s3c2440-uart
0.1% ( 0.4) matchbox-panel- : schedule_timeout (process_timeout)
0.1% ( 0.3) <kernel core> : neigh_table_init_no_netlink
(neigh_periodic_timer)
0.1% ( 0.2) phone-kit : schedule_timeout (process_timeout)
0.1% ( 0.2) <kernel core> : page_writeback_init (wb_timer_fn)
0.0% ( 0.1) init : schedule_timeout (process_timeout)
0.0% ( 0.1) dropbear : sk_reset_timer (tcp_write_timer)
0.0% ( 0.1) dropbear : schedule_timeout (process_timeout)
0.0% ( 0.1) openmoko-today : schedule_timeout (process_timeout)
0.0% ( 0.1) gsmd : tty_flip_buffer_push (delayed_work_timer_fn)
======= X, OM2007.2, dyn-tick enabled =======
PowerTOP 1.11 (C) 2007, 2008 Intel Corporation
Collecting data for 15 seconds
< Detailed C-state information is not available.>
P-states (frequencies)
Wakeups-from-idle per second : 108.7 interval: 15.0s
no ACPI power usage estimate available
Top causes for wakeups:
91.8% ( 99.7) <interrupt> : lis302dl
2.4% ( 2.6) <interrupt> : S3C2410 Timer Tick
0.9% ( 1.0) matchbox-window : schedule_timeout (process_timeout)
0.9% ( 0.9) <interrupt> : s3c2440-uart
0.9% ( 0.9) pulseaudio : schedule_timeout (process_timeout)
0.7% ( 0.8) <interrupt> : s3c2440-i2c
0.5% ( 0.5) <interrupt> : s3c2410_udc
0.4% ( 0.5) <kernel core> : queue_delayed_work_on
(delayed_work_timer_fn)
0.4% ( 0.4) matchbox-panel- : schedule_timeout (process_timeout)
0.2% ( 0.3) <kernel core> : neigh_table_init_no_netlink
(neigh_periodic_timer)
0.2% ( 0.2) <kernel core> : page_writeback_init (wb_timer_fn)
0.2% ( 0.2) gsmd : tty_flip_buffer_push
(delayed_work_timer_fn)
0.2% ( 0.2) phone-kit : schedule_timeout (process_timeout)
0.1% ( 0.1) init : schedule_timeout (process_timeout)
0.1% ( 0.1) dropbear : sk_reset_timer (tcp_write_timer)
0.1% ( 0.1) <kernel core> : __neigh_event_send (neigh_timer_handler)
0.1% ( 0.1) Xglamo : do_setitimer (it_real_fn)
======= console, dyn-tick disabled =======
PowerTOP 1.11 (C) 2007, 2008 Intel Corporation
Collecting data for 15 seconds
< Detailed C-state information is not available.>
P-states (frequencies)
Wakeups-from-idle per second : 215.1 interval: 15.0s
no ACPI power usage estimate available
Top causes for wakeups:
93.1% (200.1) <interrupt> : S3C2410 Timer Tick
2.7% ( 5.7) <interrupt> : s3c2440-i2c
2.3% ( 5.0) Xglamo : fbcon_add_cursor_timer
(cursor_timer_handler)
0.7% ( 1.5) events/0 : schedule_timeout (process_timeout)
0.3% ( 0.6) <interrupt> : s3c2410_udc
0.2% ( 0.5) <kernel core> : queue_delayed_work_on
(delayed_work_timer_fn)
0.2% ( 0.5) pulseaudio : schedule_timeout (process_timeout)
0.1% ( 0.3) <kernel core> : neigh_table_init_no_netlink
(neigh_periodic_timer)
0.1% ( 0.2) <kernel core> : page_writeback_init (wb_timer_fn)
0.1% ( 0.1) <interrupt> : pcf50633
0.1% ( 0.1) <interrupt> : s3c2440-uart
0.1% ( 0.1) init : schedule_timeout (process_timeout)
0.1% ( 0.1) gsmd : do_setitimer (it_real_fn)
0.0% ( 0.1) dropbear : sk_reset_timer (tcp_write_timer)
0.0% ( 0.1) dropbear : schedule_timeout (process_timeout)
======= console, dyn-tick enabled =======
PowerTOP 1.11 (C) 2007, 2008 Intel Corporation
Collecting data for 15 seconds
< Detailed C-state information is not available.>
P-states (frequencies)
Wakeups-from-idle per second : 13.0 interval: 15.0s
no ACPI power usage estimate available
Top causes for wakeups:
48.5% ( 6.3) <interrupt> : S3C2410 Timer Tick
38.7% ( 5.0) Xglamo : fbcon_add_cursor_timer
(cursor_timer_handler)
4.1% ( 0.5) pulseaudio : schedule_timeout (process_timeout)
4.1% ( 0.5) <kernel core> : queue_delayed_work_on
(delayed_work_timer_fn)
1.5% ( 0.2) <kernel core> : page_writeback_init (wb_timer_fn)
1.5% ( 0.2) <kernel core> : neigh_table_init_no_netlink
(neigh_periodic_timer)
1.0% ( 0.1) init : schedule_timeout (process_timeout)
0.5% ( 0.1) dropbear : sk_reset_timer (tcp_write_timer)
(there's a lot of randomness, also I just notice Xglamo didn't get
killed with /etc/init.d/xserver-nodm stop, but importantly neod did)
Cheers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Hacky-CONFIG_NO_IDLE_HZ-dyn-tick-support-for-S3C24.patch
Type: text/x-patch
Size: 9171 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20080630/4cdd59cb/attachment.bin
More information about the openmoko-kernel
mailing list