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, 1 Jul 2009 22:00:28 +0000 (15:00 -0700)
commitd5a9659f74fc3ac23cecf1db70886b919bf98ff9
tree766f43e3db733a3e9a48a1195a94548eaab97c51
parentfea44bae077d2d5b4d5197132b2556fd3882d241
Reduce VM aborts during high CPU stress.

(This was cherry-picked from master 2aa43610 for internal bug 1952616.)

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