OSDN Git Service

Reduce VM aborts during high CPU stress.
authorAndy McFadden <fadden@android.com>
Wed, 17 Jun 2009 23:29:30 +0000 (16:29 -0700)
committerAndy McFadden <fadden@android.com>
Wed, 17 Jun 2009 23:55:40 +0000 (16:55 -0700)
commit2aa43610c391868eb6ef80bf3b1f947776defcca
tree3a212711da1c0177b47059d66994b6cffbe3e568
parenteba51c25771a07993224e5ae74e8cac715985ba6
Reduce VM aborts during high CPU stress.

The VM has some timeouts that are meant to kill the current process if
something gets stuck (e.g. a thread grabs a lock and then manages to die
while the rest of the process continues on).  These were tripping a
little too easily during some high-load situations.

This changes the order of operations so that we now unlock the "thread
suspend" lock before sending a wakeup broadcast to the condition variable
that threads sleep on.  This should make it less likely for a thread to
be running for an extended period while the lock is held.  (Relates to
internal bug 1664687.)

This also wraps a couple of things (pthread_create, dlopen) with a state
change to VMWAIT.  During high load situations these can take a while to
complete, and we would (with the K-Means Visualizer load generator
running) very occasionally time out.

Augmented the debug output in a couple of minor ways.  Updated comments.
vm/Globals.h
vm/Native.c
vm/Thread.c