Freezing user space processes

1,141 views
Skip to first unread message

Jebediah Huang

unread,
Apr 4, 2010, 12:03:09 AM4/4/10
to android-...@googlegroups.com, android...@googlegroups.com
I added external application that reads some data from serial port.
When Android suspend, it says:
<6>[ 757.743150] request_suspend_state: sleep (0->3) at 757743750809
(1970-01-01 00:12:37.743740962 UTC)
<6>[ 758.220460] PM: Syncing filesystems ... done.
<4>[ 758.226651] Freezing user space processes ...
<3>[ 758.235448] Freezing of user space aborted
<3>[ 758.239823] serialfmread

In logcat, after resume:

I//system/bin/serialfmread( 690): serialfmread: done doing read
I/logwrapper( 690): /system/bin/serialfmread terminated by exit(0)

and then it restart my application. My application is input device
reader generating input event and it does not touch wakelocks. Is
there something I must do to my application to make it behave
correctly with Android wakelock?

Jeb

Dianne Hackborn

unread,
Apr 4, 2010, 2:23:08 AM4/4/10
to android-...@googlegroups.com, android...@googlegroups.com
The program needs to hold a partial wake lock during the time it needs to keep the CPU running.


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.




--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Jebediah Huang

unread,
Apr 4, 2010, 2:27:11 AM4/4/10
to hac...@android.com, android-...@googlegroups.com, android...@googlegroups.com
I don't want it to keep the CPU running. I want the system to suspend
at that point even if there's IO on the serial port. Do I have to add
wakelocks to the app to achieve that?

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>

Dianne Hackborn

unread,
Apr 4, 2010, 2:46:21 AM4/4/10
to Jebediah Huang, android-...@googlegroups.com, android...@googlegroups.com
I guess I don't understand what you are asking.  Wakelocks keep the system from going to sleep.  If you want it to go to sleep, but for some reason it isn't, then you need to find out who else is holding a wake lock to keep it awake.  You can't use a wake lock to force it to go to sleep.

There are many drivers that will acquire wake locks themselves at various points to make sure the system continues running long enough to process their work -- for example when receiving data over the network.  I don't know whether or not the serial driver does this.

Jebediah Huang

unread,
Apr 4, 2010, 3:07:29 AM4/4/10
to Dianne Hackborn, android-...@googlegroups.com, android...@googlegroups.com
Thanks. I see only few driver using wake_lock, so maybe it is:
./drivers/input/evdev.c: wake_lock_init(&client->wake_lock,
WAKE_LOCK_SUSPEND, "evdev");
because my application causes input events.

Showing
name count expire_count wake_count active_since
total_time sleep_time max_time last_change
"PowerManagerService" 6 0 0 0 12329155095
0 6595255691 135341930515
"KeyEvents" 4 0 0 0 196387699 0
117465540 134877866201
"evdev" 0 0 0 0 0 0 0 0
"radio-interface" 1 0 0 0 1000892610
0 1000892610 67683891432
"evdev" 0 0 0 0 0 0 0 0
"alarm_rtc" 0 0 0 0 0 0 0 0
"alarm" 0 0 0 0 0 0 0 0
"unknown_wakeups" 0 0 0 0 0 0
0 0
"deleted_wake_locks" 0 0 0 0 0 0
0 0
"main" 1 0 0 163889201251 163889201251 0
163889201251 230000017
"evdev" 1 1 0 0 4998200305 0
4998200305 129641814194

Each time that the system tried to suspend, it aborted and then I see
in the wakeups:
"PowerManagerService" 11 0 0 0 18525292659
0 6595255691 329246484660
"KeyEvents" 12 0 0 0 356830782 0
117465540 327528918500
"radio-interface" 1 0 0 0 1000892610
0 1000892610 67683891432
"evdev" 0 0 0 0 0 0 0 0
"alarm_rtc" 0 0 0 0 0 0 0 0
"alarm" 0 0 0 0 0 0 0 0
"unknown_wakeups" 0 0 0 0 0 0
0 0
"deleted_wake_locks" 0 0 0 0 0 0
0 0
"main" 1 0 0 331048659713 331048659713 0
331048659713 230000017
"evdev" 1 1 0 0 4998200305 0
4998200305 129641814194
"evdev" 1 1 0 0 4996976308 0
4996976308 195603038191
"evdev" 1 1 0 0 4996339691 0
4996339691 261683674808
"evdev" 1 0 0 3772348000 3772348000 0
3772348000 327506362499

Does this mean evdev leaking locks?

Reply all
Reply to author
Forward
0 new messages