summaryrefslogtreecommitdiffstats
path: root/libs/binder/IPCThreadState.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Ensure that binder incalls to the system process keep the fg cgroupChristopher Tate2010-03-181-18/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Propagate background scheduling class across processes.Dianne Hackborn2009-12-071-15/+38
| | | | | | | | | | | 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.
* Reset binder service threads' cgroup/priority after command completionChristopher Tate2009-11-081-0/+15
| | | | | | | | | 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
* Revert jparks code from IPCThreadState.Evan Millar2009-11-061-5/+0
|
* When a thread is about to be put back onto the thread pool ensure that it is ↵Jason Parks2009-11-041-22/+4
| | | | in the foreground cgroup.
* Add a warning when we leave threads in the binder thread pool in the ↵Jason Parks2009-11-031-0/+28
| | | | background scheduling group.
* Instead of using -1 for pid and uid in the simulator, and then havingMarco Nelissen2009-07-171-7/+2
| | | | | to special-case the simulator case all over the framework, just use getuid and getpid, and intercept those in the simulator wrapper.
* move libbinder's header files under includes/binderMathias Agopian2009-05-201-3/+3
|
* checkpoint: split libutils into libutils + libbinderMathias Agopian2009-05-201-0/+1030