Commit graph

21 commits

Author SHA1 Message Date
Dima Zavin
29319a6753 cutils: sched_policy: remove audio app/sys groups, merge into fg
Bug: 6528015
Change-Id: I6c2658b62442d811b53c6d18476fbd6cd45f9e3f
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 13:20:17 -07:00
Dima Zavin
13ed76bfbc cutils: sched_policy: make bg group be nested under fg
Adds an apps cgroup which will contain fg tasks. Move the bg group
nested underneath it.

Bug: 6538553
Change-Id: I55279415da625e15a5bb061c2b45fbe7f7a4c047
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 10:42:40 -07:00
Jeff Brown
5b878d24c1 Revert "Revert "Use O_CLOEXEC when opening cgroup fds.""
This reverts commit 4df54bc4a8.
2012-05-08 15:07:58 -07:00
Jeff Brown
bff8f3fa98 Add stubs for host builds.
Bug: 4466013
Change-Id: I5633c841e71a48357bb04cd7ccc02550c17bde22
2012-05-08 15:07:32 -07:00
Jeff Brown
4df54bc4a8 Revert "Use O_CLOEXEC when opening cgroup fds."
This reverts commit e1440d81ae
2012-05-08 14:58:30 -07:00
Jeff Brown
e1440d81ae Use O_CLOEXEC when opening cgroup fds.
Bug: 4466013
Change-Id: I0d2e915fc550a0ecaccad5e452dd4c87fc878b8b
2012-05-08 13:41:10 -07:00
Glenn Kasten
10ec3c7645 Add more SP_ constants
Change-Id: I52c8ea33b9b915fc08546f2ca0b191391f58506b
2012-04-23 17:34:06 -07:00
Glenn Kasten
69bfb1f099 Scheduling group cleanup - add comment, SP_DEFAULT
Also tid == 0 maps to gettid() on platforms that support it.
This is needed by mediaserver code that was formerly using
the old C++ API.

Change-Id: I8baaa3e42315c9b924cec26b6da01e7cb69e0078
2012-04-20 10:31:50 -07:00
Glenn Kasten
86c7cc8189 Add get_sched_policy_name() and use in ps and top
This will make it easier to add additional policies (cgroups) if needed.
Also added comments to the sched_policy APIs.

Change-Id: I33ce1cc4deae10983241f7391294b7a512d2c47c
2012-03-15 15:10:45 -07:00
Brad Fitzpatrick
86b121523d fix windows SDK build
Change-Id: I2c563b20197803cafa91214aeff2c06fc0c75580
2010-05-08 11:51:13 -07:00
Brad Fitzpatrick
e43c248316 More fixes to Binder perf regression from Eclair
Re-use the file descriptor to change the cgroups.  There's a fast path
in the kernel for the case where the value's already uncahnged.  Also,
this is okay because the kernel ignores the write offset.  This is
essentially a ioctl-ish/datagram interface, despite being a fd we're
writing to.

This reduces Dalvik->Dalvik void/void Binder calls on Sapphire from
~1.2 to ~0.8 ms.  This is a bit slower than the ~0.7 ms we get
avoiding the write altogether.

strace confirms:

[pid  1557] ioctl(21, 0xc0186201 <unfinished ...>
[pid  1556] <... ioctl resumed> , 0x45399cd0) = 0
[pid  1556] write(22, "1556", 4)        = 4
[pid  1556] ioctl(21, 0xc0186201 <unfinished ...>
[pid  1555] <... ioctl resumed> , 0x45299cd0) = 0
[pid  1555] write(22, "1555", 4)        = 4
[pid  1555] ioctl(21, 0xc0186201 <unfinished ...>
[pid  1554] <... ioctl resumed> , 0x45199cd0) = 0
[pid  1554] write(22, "1554", 4)        = 4

BUG=2660235

Change-Id: Ia9f9e1d5b792eaebc9560f89931faf6df0cf9c0d
2010-05-07 15:57:44 -07:00
Brad Fitzpatrick
253e27acb6 Optimize set_sched_policy(), which gets called in every binder call.
- use static /dev/cpuctl filenames, rather than sprintf() on the fly
- use a custom formatter instead of sprintf() for the tid number

This is a simplified version of Dan's original
Ifc9c81f74fe65f0695ead53b30194bc6adf00da0 to be less risky for Froyo.

Bug: 2660235
Change-Id: I744bbc2ec01fd2569612c814a497df40a933b622
2010-05-06 11:14:09 -07:00
San Mehat
7e8529a8b5 system/core: Switch libsysutils & sched_policy LOG -> SLOG
Change-Id: Id74c6895a8012c5915f2e259339101844de7c085
Signed-off-by: San Mehat <san@google.com>
2010-03-25 09:31:42 -07:00
San Mehat
503df20759 cutils: sched_policy: Make getSchedulerGroup() play nicely with multiple control groups
Signed-off-by: San Mehat <san@google.com>
2010-03-02 17:09:56 -08:00
San Mehat
c1c38dd01c system: sched_policy: Don't return an error when the thread we're trying to move exits on us
Signed-off-by: San Mehat <san@google.com>
2009-12-03 12:19:12 -08:00
San Mehat
805d67ab11 cutils: sched_policy: Fix bug where we were unable to move backgrounded threads into the foreground
Signed-off-by: San Mehat <san@google.com>
2009-10-29 13:56:26 -07:00
San Mehat
d2e4e46ce4 cutils: schedpolicy: Add debug code to log sched policy transitions
Signed-off-by: San Mehat <san@google.com>
2009-10-29 11:50:01 -07:00
San Mehat
c0dfca7ae1 cutils: Add support for reading a processes scheduler policy
Signed-off-by: San Mehat <san@google.com>
2009-10-27 12:27:42 -07:00
Raphael
0384a98d6f Disable sched_policy under Windows.
This introduces a new HAVE_SCHED_H arch define, which is used
to prevent from building sched_policy.c during the Windows SDK.

Change-Id: I3667857a4ae7d6baaf1efd1cd187a5baf91419d8
2009-09-15 17:10:17 -07:00
San Mehat
3cd5b66ba0 libcutils: Dont include kernel header + add defines
Signed-off-by: San Mehat <san@google.com>
2009-09-14 16:05:51 -07:00
San Mehat
493dad9663 libcutils: Add abstracted support for setting scheduler policies
Also changes the background policy to use SCHED_BATCH. IDLEPRIO
can cause 100% starvation.

Signed-off-by: San Mehat <san@google.com>
2009-09-12 10:48:03 -07:00