Commit graph

72 commits

Author SHA1 Message Date
Mark Salyzyn
8a7297a09f Merge "system/core: preparation to pull back interfaces from android/log.h"
am: 27d2d49f48

Change-Id: I604bb1d4cf62636663fa92e3d14a55887dbcae23
2016-10-20 18:03:57 +00:00
Mark Salyzyn
cfd5b080af system/core: preparation to pull back interfaces from android/log.h
Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.

Correct liblog/README

Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.

Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
2016-10-20 08:11:39 -07:00
Mark Salyzyn
9bb1f2f915 libcutils: Replace cutils/log.h with android/log.h am: 23ed4c242a am: f56fce0240
am: 9fd2eaf827

Change-Id: If01fd686fc15aaf74b6f06b7e661eb46e127d51b
2016-09-30 22:17:30 +00:00
Mark Salyzyn
23ed4c242a libcutils: Replace cutils/log.h with android/log.h
Replace references to cutils/log.h and log/log.h with android/log.h.
Point cutils/log.h to android/log.h. Adjust header order to comply
with Android Coding standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I4b00c0dff3a0a50cbb54301fdc5a6c29c21dab65
2016-09-30 12:47:05 -07:00
John Reck
4409555732 Merge "Fix access check" am: 87ef739dba am: 9cbbe2d9df
am: cf2f39d7de

Change-Id: I37d1d5c616a6a68751a63e05fdf6c0199b0fd671
2016-08-30 01:31:17 +00:00
John Reck
2e336b1da1 Fix access check
Fixes a bug where USE_CPUSET used access(F_OK)
as a sign that it should try writing to the cpuset
path. It needs to instead use access(W_OK) to
ensure that it has write access as that's what
it would try to open() with.

And stop trying to repeatedly open a file that
doesn't exist.

Change-Id: Ib391ee6f08345051c48a986a732eda30143cb614
2016-08-26 14:05:03 -07:00
Elliott Hughes
c4f153e97b Merge "Remove the prctl PR_SET_TIMERSLACK_PID call." am: b3654fa086 am: fb7e8a0088
am: a9638e7ff6

Change-Id: I170c97da6dd147d37bb8750bc4c750bf676d611d
2016-08-04 02:36:15 +00:00
Elliott Hughes
fb7e8a0088 Merge "Remove the prctl PR_SET_TIMERSLACK_PID call."
am: b3654fa086

Change-Id: I5f833a1497fcbb8b7c3f1efcd707b6186a6409e6
2016-08-04 02:31:12 +00:00
Elliott Hughes
d7967c1347 Remove the prctl PR_SET_TIMERSLACK_PID call.
This is broken on all devices other than N9, and has no real path to fixing
it because there are so many different values already in use (41, 43, 47,
127), with no way to tell which you should use on any given device.

Bug: http://b/30597190
Change-Id: I07eeaaf6f5dc03c5532ffbfbb85ef2ad750206a0
2016-08-03 15:11:01 -07:00
John Stultz
5758078f5e Merge \\\"sched_policy: Add support for /proc/<tid>/timerslack_ns over PR_SET_TIMERSLACK_PID\\\" am: 817d53493a am: acf5e849b4
am: 304c1264d4

Change-Id: I6055ee00f85e84d1748745415170acfdd0d690ec
2016-07-30 05:29:06 +00:00
John Stultz
acf5e849b4 Merge \"sched_policy: Add support for /proc/<tid>/timerslack_ns over PR_SET_TIMERSLACK_PID\"
am: 817d53493a

Change-Id: Iea895b632b3bfa7daae0be34c2cc69563a18a6d5
2016-07-30 05:20:34 +00:00
John Stultz
2f13f0a48a sched_policy: Add support for /proc/<tid>/timerslack_ns over PR_SET_TIMERSLACK_PID
The PR_SET_TIMERSLACK_PID number has collided with upstream
changes a number of times, and thus the number is not consistent
between AOSP common kernel versions.

In 4.6+, the upstream kernel added equivalent functionaity via
the /proc/<tid>/timerslack_ns entry.

This patch changes the sched_policy logic to support
/proc/<tid>/timerslack_ns if its available, falling back to the
older PR_SET_TIMERSLACK_PID method if not.

NOTE: Eventually PR_SET_TIMERSLACK_PID usage will need to be
removed as it is likely to conflict with valid future upstream
PR_* entries.

Also add missing O_CLOEXEC to other open calls in this file.

Change-Id: Iec0b8a62de0dc8bdd57b60df82bd4d31c5d64709
Signed-off-by: John Stultz <john.stultz@linaro.org>
2016-07-29 14:30:20 -07:00
Tim Murray
b386d72266 Merge \"Add support for background stune group.\" into nyc-mr1-dev
am: 531bdd5a2c

Change-Id: Ia3be10db68dffc44e2d70535544c7c59d0933f7d
2016-07-11 23:55:17 +00:00
Tim Murray
5dcff8f2b1 Add support for background stune group.
bug 29512132

Change-Id: If8144bfee0fb30cf11f2bb26494ca5e83c11d4d7
2016-07-11 13:57:31 -07:00
Tim Murray
b8a19f4499 Merge changes from topic \'stune\' into nyc-mr1-dev
am: 4b75a86858

Change-Id: Ib11061d5d539f2e82ad16f122ea7d7b621bd988d
2016-07-11 20:35:56 +00:00
Tim Murray
955694b657 Add support for top-app stune group.
bug 29512132

Change-Id: I41ec2dd80a469309f48dbb59fc27fbe43fcd67b3
2016-07-11 11:40:15 -07:00
Tim Murray
aa45cb85e3 Set stune groups from set_sched_policy.
bug 29512132

Change-Id: Ib4176b80787db9e7ace9468cbf670f05cc428786
2016-07-11 10:05:56 -07:00
Srinath Sridharan
ee85737277 Merge \"Not dynamically add system-background tasks to bg_schedboost_fd.\" into nyc-mr1-dev
am: 08d097adb4

Change-Id: I54a0332ad0bb61c3db5dbc5fc8a5be2558f356d6
2016-06-30 22:55:43 +00:00
Srinath Sridharan
70a415f8b8 Not dynamically add system-background tasks to bg_schedboost_fd.
System-background tasks can be either in bg_schedboost_fd or fg_schedboost_fd.
It is better to set the right cgroup via init.rc and not dynamically in
set_cpuset_policy.

BUG: 29533997
BUG: 29512132
Change-Id: If5dab78eafbe2d0d03fd7fd3f36d794cb4a7645f
2016-06-30 14:38:07 -07:00
Srinath Sridharan
e7b8d06f18 Merge "Only apply schedTune boost to top-app tasks" into nyc-mr1-dev
am: 87a4f046f0

* commit '87a4f046f01ff49d69e4ff2446266c29557fb5e1':
  Only apply schedTune boost to top-app tasks

Change-Id: I32ec1f0811971a527234672cadeeddcb50fd1369
2016-05-24 00:14:03 +00:00
Srinath Sridharan
1339871138 Only apply schedTune boost to top-app tasks
When using EAS, the foreground tasks were all getting boosted
during touchboosts. Limit it to top-app tasks.


BUG: 28378389
Change-Id: I72b7158a614bfd9b6c61024774e408ceba61fc9c
2016-05-23 23:59:38 +00:00
Elliott Hughes
2af9f2fe82 Merge "More secure and compiler warning fix for sprintf into snprintf" am: 4f21555
am: e05688a

* commit 'e05688a176c27025d59c0a512501a411b56f1bb1':
  More secure and compiler warning fix for sprintf into snprintf

Change-Id: I93d4ff6d1c2674113d481ff06170d19f31951346
2016-04-19 22:23:33 +00:00
Raja M
a2f37e4fd7 More secure and compiler warning fix for sprintf into snprintf
To fix GCC WARNINGS while building.
or
To support error free -D_FORTIFY_SOURCE=2 strict mode compilation.

Change-Id: I999bd83785456a77247e5e1d708e2bdde2eb057b
2016-04-20 02:20:50 +05:30
Martijn Coenen
7b173a148b Update get_sched_policy to return TOP_APP correctly.
Currently get_sched_policy() would only return foreground
or background, but not TOP_APP, since it's not looking
at CPUsets at all.

Fixing this makes testing easier, and it also corrects
the output of "ps -P" to show "ta" for current top app.

Bug: 27857142
Change-Id: I589cacc107f355de15750f01b06f404b59a0f99b
2016-04-04 17:11:56 +02:00
Todd Kjos
d125f6e8a9 Merge "Mount schedTune cgroup as /dev/stune" into nyc-dev 2016-02-26 17:35:50 +00:00
Tim Murray
b43225eefb Fix build break with uninitialized boost_fd.
Change-Id: Icf209e2e0f4835db01f61dbf83b4715db9ef03a9
(cherry picked from commit def6c151f4)
2016-02-25 23:53:08 +00:00
Todd Kjos
11cde567a8 Mount schedTune cgroup as /dev/stune
Make stune consistent with the other cgroups mounted under /dev

Change-Id: I0fe7120ad2afbe8e6a3c9f72cc3f465de618d344
2016-02-23 09:08:54 -08:00
Tim Murray
6647bb5130 Enable top-app cpuset support.
Allows ActivityManager to use the top-app cpuset to grant the currently
focused app exclusive access to a CPU core.

Change-Id: I45bca5170477e413dec6e5889338399d0859706c
2016-02-01 15:03:16 -08:00
Tim Murray
4284f9f3a3 Improve cpuset support for surfaceflinger.
SurfaceFlinger needs some of its threads in the system-background cpuset
and some of its threads (the binder pool) outside of the
system-background cpuset in order to improve UI perf/power
consumption. Remove surfaceflinger from the system-background cpuset in
init.rc and allow a thread to place itself in the system-background
cpuset given enough permissions.

bug 25745866

Change-Id: I85f7e41c5439e6ad7cc2d355e51f5dfb3a0c7088
2016-01-22 14:06:50 -08:00
Todd Kjos
88b5892d74 resolve merge conflicts of ed60788968 to mnc-dr2-dev-plus-aosp.
Change-Id: I9b07dd8dcb8fc74b658466b8dd47546cefffab1d
2015-11-18 08:31:03 -08:00
Todd Kjos
ba8a47531c Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 14:57:47 -08:00
Todd Kjos
ed60788968 Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 08:53:04 -08:00
Elliott Hughes
5ec940aed8 am fb1ecbc5: am e6e71608: Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
* commit 'fb1ecbc55e7edeafb138eb2a60ca89ba9a7b1f0f':
  Use __ANDROID__ instead of HAVE_ANDROID_OS.
2015-07-30 16:50:27 +00:00
Elliott Hughes
9b828adfad Use __ANDROID__ instead of HAVE_ANDROID_OS.
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-07-30 09:33:43 -07:00
Elliott Hughes
919bb66f73 Fix libcutils build.
Change-Id: I4df2065f60f5363877809161298c1f9718252934
(cherry picked from commit 8a8953bb3d)
2015-07-25 04:06:57 +00:00
Todd Kjos
1fb6e24f19 Merge "Fix janky navbar ripples -- incorrect timerslack values" into mnc-dev 2015-06-29 22:29:54 +00:00
Todd Kjos
4cdce427f9 Fix janky navbar ripples -- incorrect timerslack values
If a thread is created while the parent thread is "Background",
then the default timerslack value gets set to the current
timerslack value of the parent (40ms). The default value is
used when transitioning to "Foreground" -- so the effect is that
the timerslack value becomes 40ms regardless of foreground/background.

This does occur intermittently for systemui when creating its
render thread (pretty often on hammerhead and has been seen on
shamu). If this occurs, then some systemui animations like navbar
ripples can wait for up to 40ms to draw a frame when they intended
to wait 3ms -- jank.

This fix is to explicitly set the foreground timerslack to 50us.

A consequence of setting timerslack behind the process' back is
that any custom values for timerslack get lost whenever the thread
has transition between fg/bg.

See Bug: 19398120

Change-Id: Idc259717f62fa2255f8bafbbf88b68c0043f29cf
2015-06-25 14:29:07 -07:00
Tim Murray
999102664c Don't set cgroup policy when updating cpusets.
bug 21782794

Change-Id: I3b2cf8ae4f3ed0c14f206584ae7fa2b1a1d11ad0
2015-06-22 14:00:56 -07:00
Tim Murray
b769c8d24f add cpuset support to libcutils
bug 21782794

Change-Id: I249531754fb29442dc3c7434d77dbb103f4220a7
2015-06-11 18:35:46 -07:00
Elliott Hughes
27484f2e74 am fae953eb: Merge "HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>."
* commit 'fae953ebccfabfa500b3ebca93202063c8e3501d':
  HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>.
2014-12-15 02:00:31 +00:00
Elliott Hughes
6acf3d7703 HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>.
Change-Id: Ica7940c00d1d5da9d50711fd138dd459deec9b6d
2014-12-14 16:51:36 -08:00
Riley Andrews
d1380d645d am 33b33549: Merge "Make the default cgroup, the foreground cgroup." into lmp-mr1-dev
* commit '33b335495c7b8eea4b9af13a7157cf83cd085129':
  Make the default cgroup, the foreground cgroup.
2014-10-08 20:51:48 +00:00
Riley Andrews
522d72b702 Make the default cgroup, the foreground cgroup.
All kernel services will now be in the same cgroup as
foreground applications. This will now make kernel threads
not implicitly higher priority than android foreground
services.

Bug 17681097

Change-Id: I28e81c7aade50428d5395df86f00ce01c1e7af02
2014-10-07 19:24:54 +00:00
Elliott Hughes
10cce72c4b am 3859029a: am 7fb0ee0c: Merge "Remove androidGetTid."
* commit '3859029a48aa78150fa61eb4988214f8632b33ce':
  Remove androidGetTid.
2014-08-18 19:34:23 +00:00
Elliott Hughes
b7659613b2 Remove androidGetTid.
Bug: 17048545
Change-Id: I93cbb2d7bd18d506b5f5f7f262dd9ac0fca053b4
2014-08-18 10:47:37 -07:00
Elliott Hughes
400c381835 Move sched_policy.c off bionic's PR_SET_TIMERSLACK_PID.
Change-Id: I3a27803d46b5b88a10aa8043a114d780ed685e56
2014-07-17 17:15:14 -07:00
Elliott Hughes
e07d77e422 Use <sys/prctl.h> instead of <linux/prctl.h>.
Change-Id: I708da00e36a9da8be9184c451453774be6b78c06
2014-07-11 20:58:55 -07:00
Mark Salyzyn
b8f86480a2 am a0a461d3: am 82e1b89f: am a32e01d2: Merge "libcutils: turn on -Werror"
* commit 'a0a461d3b7d85484c10db64f078427a5be3da189':
  libcutils: turn on -Werror
2014-05-02 17:12:27 +00:00
Mark Salyzyn
12717169a5 libcutils: turn on -Werror
- Deal with some -Wunused / -Wunused-variable issues

Change-Id: I28c23fb213382a392ec30935749fb359e072d664
2014-05-01 17:58:17 -07:00
Ruchi Kandoi
f4362ccdd5 Fix build problems caused by commit:
422852ef5c for non-linux hosts.

Change-Id: I00b9c99b9d9d072f19549b3a9970a27e75cd49b7
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2014-04-24 00:35:46 +00:00