History log of /frameworks/base/libs/binder/IPCThreadState.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7182ef360498b7f45cc5253c167bd9975cfc5335 19-Mar-2010 Christopher Tate <ctate@google.com> Ensure that binder incalls to the system process keep the fg cgroup

On binder incalls, the handler thread is given the caller's priority by the
driver, but not the caller's cgroup. We have explicit code that sets the
handler's cgroup to match the caller's, *except* that the system process
explicitly disables this behavior. This led to a siuation in which we were
running binder incalls to the system process at nice=10 but cgroup=fg.

That's fine as far as it goes, except that if a GC happened in the handler
thread, it would be promoted to foreground priority and cgroup both, to avoid
having the GC take forever. Then, when GC finished, the original priority
is reset, and the cgroup set *based on that priority*. This would push the
handler thread into nice=10 cgroup=bg_non_interactive -- which matches the
caller, but is supposed to be impossible in the system process.

The end result of this was that we could be running "lengthy" operations in
the system process in the background. Unfortunately, some of the operations
that wound up like this would hold important global system locks for up to
twenty seconds as a result, making the entire device unresponsive to input
for that period.

This CL fixes the binder incall setup to ensure that within the system process,
a binder incall is always begun from the normal foreground priority as well
as cgroup. In practice now the device still becomes laggy/sluggish when the
offending lock-holding time-consuming incall occurs, but since it still runs
as a foreground task it is able to proceed to completion within a short time
rather than taking 20 seconds.

Fixes bug #2403717

Change-Id: Id046aeabd0e80c48eef94accc37842835eab308d
/frameworks/base/libs/binder/IPCThreadState.cpp
887f355f99ff83d568ef2885a4fdcaae475583df 08-Dec-2009 Dianne Hackborn <hackbod@google.com> Propagate background scheduling class across processes.

This is a very simply implementation: upon receiving an IPC, if the handling
thread is at a background priority (the driver will have taken care of
propagating this from the calling thread), then stick it in to the background
scheduling group. Plus an API to turn this off for the process, which is
used by the system process.

This also pulls some of the code for managing scheduling classes out of
the Process JNI wrappers and in to some convenience methods in thread.h.
/frameworks/base/libs/binder/IPCThreadState.cpp
1dacdd482894bee9fbc1993cbb525fb800750222 08-Nov-2009 Christopher Tate <ctate@android.com> Reset binder service threads' cgroup/priority after command completion

To prevent buggy command implementations from poisoning binder threads'
scheduling class & priority for future command execution, we now reset the
cgroup and thread priority to foreground/normal when a binder service thread
finishes executing the designated command.

Change-Id: Ibc0ab2485751453f6dc96fdb4eb877fd02796e3f
/frameworks/base/libs/binder/IPCThreadState.cpp
97b30e2f6239a3ca2b9489ce09320aaf317f9fc8 06-Nov-2009 Evan Millar <emillar@google.com> Revert jparks code from IPCThreadState.
/frameworks/base/libs/binder/IPCThreadState.cpp
2867746d7b59579ecf7b2de41e42fc1ca88d04d9 04-Nov-2009 Jason Parks <jparks@google.com> When a thread is about to be put back onto the thread pool ensure that it is in the foreground cgroup.
/frameworks/base/libs/binder/IPCThreadState.cpp
dabcf4151adeb1376ce3b6c9f4b060f9b7fd8a16 03-Nov-2009 Jason Parks <jparks@google.com> Add a warning when we leave threads in the binder thread pool in the background scheduling group.
/frameworks/base/libs/binder/IPCThreadState.cpp
e1babd45e1f849522b63c80d4602ec50eac74cff 17-Jul-2009 Marco Nelissen <marcone@google.com> Instead of using -1 for pid and uid in the simulator, and then having
to special-case the simulator case all over the framework, just use
getuid and getpid, and intercept those in the simulator wrapper.
/frameworks/base/libs/binder/IPCThreadState.cpp
0795272aa226f4e965968a03daddc53ce30b7cda 20-May-2009 Mathias Agopian <mathias@google.com> move libbinder's header files under includes/binder
/frameworks/base/libs/binder/IPCThreadState.cpp
25ba5b6564224dceefa086b5c439ef28dad530ca 19-May-2009 Mathias Agopian <mathias@google.com> checkpoint: split libutils into libutils + libbinder
/frameworks/base/libs/binder/IPCThreadState.cpp