location service is waking up at 10Hz causing possible unwanted wakeups

Bug #1350871 reported by Colin Ian King
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
The Ubuntu Power Consumption Project
New
Undecided
Unassigned
location-service (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

I've observed that location service is waking up ~10 times per second due to a 100ms sleep

ps -ax | grep 2295
 2295 ? Ssl 0:00 /usr/bin/ubuntu-location-serviced --bus system --provider gps::Provider

eventstat shows it's the top waking userspace process on the phone:

root@ubuntu-phablet:/# eventstat 300 1
 Event/s PID Task Init Function Callback
    9.99 2304 ubuntu-location hrtimer_start_range_ns hrtimer_wakeup

health-check shows that this is occuring in a 100ms nanosleep() system call.

Attached is the output from health-check. Is is possible to use a select() or poll() rather than a 10Hz non-blocking delay loop to reduce polling wakeups?

Revision history for this message
Colin Ian King (colin-king) wrote :
Changed in location-service (Ubuntu):
importance: Undecided → High
Revision history for this message
Thomas Voß (thomas-voss) wrote :

I tried to reproduce the wakeups with the location service being idle -> no wakeups
Whenever the location engine is started, though, the chipset driver wakes up regularly roughly at the reported interval. I would like to patch that behavior, but the chipset driver is unfortunately a binary blob.

tags: added: rtm14
Thomas Strehl (strehl-t)
Changed in location-service (Ubuntu):
assignee: nobody → Thomas Voß (thomas-voss)
Revision history for this message
Colin Ian King (colin-king) wrote :

BTW, which binary blob is the chipset driver? i don't mind looking at it and seeing if we can "tweak" it a bit.

Thomas Strehl (strehl-t)
tags: added: touch-2014-09-25
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in location-service (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confirmed. Even after turning off all location services, this continues to have the highest number of wakeups of any user service:

$ sudo eventstat
 Event/s PID Task Init Function Callback
   26.00 0 [swapper/0] hrtimer_start_range_ns tick_sched_timer
   20.00 0 [swapper/0] hrtimer_start tscpu_update_tempinfo
   20.00 22750 [kworker/0:0] OSTimerWorkQueueCallBack OSTimerCallbackWrapper
   10.00 2556 ubuntu-location hrtimer_start_range_ns hrtimer_wakeup <------------------------------------------------
    8.00 0 [swapper/0] hrtimer_start tick_sched_timer
    5.00 25671 unity8 hrtimer_start_range_ns hrtimer_wakeup
    3.00 57 [hps_main] _hps_task_main process_timeout
    2.00 1370 gmain hrtimer_start_range_ns hrtimer_wakeup
    2.00 25706 ubuntu-push-cli hrtimer_start_range_ns hrtimer_wakeup
    1.00 1 [swapper/0] start_bandwidth_timer sched_rt_period_timer
    1.00 0 [swapper/0] mlog_timer_handler mlog_timer_handler
    1.00 1879 [tx_thread] __pm_wakeup_event pm_wakeup_timer_fn
    1.00 22750 [kworker/0:0] osal_timer_modify _stp_psm_stp_is_idle
    1.00 15947 sshd sk_reset_timer tcp_write_timer
    1.00 25751 ubuntu-push-cli hrtimer_start_range_ns hrtimer_wakeup
    1.00 0 [swapper/0] add_timer wmt_cal_stats
    1.00 847 6620_launcher hrtimer_start_range_ns hrtimer_wakeup
    1.00 22750 [kworker/0:0] schedule_timeout_uninterruptible process_timeout
    1.00 1 [swapper/0] hrtimer_start charger_hv_detect_sw_workaround
106 Total events, 106.00 events/sec (kernel: 84.00, userspace: 22.00)

The PID is deceiving. It's actually a thread of a different PID which is /usr/bin/ubuntu-location-serviced

$ system-image-cli -i
current build number: 94
device name: arale
channel: ubuntu-touch/rc-proposed/ubuntu
last update: 2015-08-28 07:44:31
version version: 94
version ubuntu: 20150828
version device: 20150818-0b38025
version custom: 20150828

tags: added: phablet
Revision history for this message
Thomas Voß (thomas-voss) wrote :

I'm not saying that it's not waking up, just pointing out that we have no way of fixing the source of the wakeups for now. Lowering priority.

Changed in location-service (Ubuntu):
status: Confirmed → Triaged
importance: High → Medium
assignee: Thomas Voß (thomas-voss) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.