Commit graph

30523 commits

Author SHA1 Message Date
Raman Tenneti
2cd86af9ed Merge "Revert "Revert "Make system property reads wait-free"""
am: afe44cc483

Change-Id: I8ef30dc382edb27a4dc91a5215e94da2a7e6a654
2019-11-12 12:53:55 -08:00
Raman Tenneti
afe44cc483 Merge "Revert "Revert "Make system property reads wait-free""" 2019-11-12 20:43:29 +00:00
Raman Tenneti
b481a2e743 Revert "Revert "Make system property reads wait-free""
This reverts commit de39d9242a.

Reason for revert: This revert is not needed

Change-Id: I34af8e5d75c724f6c4066fafbfc6bc7d58377601
2019-11-12 20:41:55 +00:00
jaishank
6348ec0181 Merge "Optimized L2 Cache value for Intel(R) Core Architectures."
am: e5c900f011

Change-Id: Id412d3078c2425eeb1c8aab7941060f62ff4f358
2019-11-12 12:41:48 -08:00
Treehugger Robot
e5c900f011 Merge "Optimized L2 Cache value for Intel(R) Core Architectures." 2019-11-12 20:35:38 +00:00
Raman Tenneti
3d9fcdea65 Merge "Revert "Make system property reads wait-free""
am: 1b28efa2d1

Change-Id: I3e28d605f3565700357ce8f396466e6c99cff72f
2019-11-12 10:39:36 -08:00
Raman Tenneti
1b28efa2d1 Merge "Revert "Make system property reads wait-free"" 2019-11-12 18:26:48 +00:00
Raman Tenneti
de39d9242a Revert "Make system property reads wait-free"
This reverts commit 0cf90556de.

Reason for revert: Device boot failures - 144355953

Change-Id: Icd4fc8c7a1d06d688a6d37e6f1c1aa45563f711b
2019-11-12 18:24:06 +00:00
Daniel Colascione
51cbf0d248 Merge "Make system property reads wait-free"
am: 985e678516

Change-Id: Id2b979d61d2f0d96b9ce7642914447a7d18f34f5
2019-11-12 09:28:56 -08:00
Treehugger Robot
985e678516 Merge "Make system property reads wait-free" 2019-11-12 17:14:30 +00:00
jaishank
2e50fa7cf8 Optimized L2 Cache value for Intel(R) Core Architectures.
Performance Gain:
AnTuTu             - 4.80%
3D Mark Sling Shot - 3.47%
BaseMarkGPU        - 5.51%
GeekBench          - 3.19%

Test: ./tests/run-on-host.sh 64

Change-Id: I6122835a3f5fd97cc291623d1062fe25843a2d93
Signed-off-by: jaishank <jaishankar.rajendran@intel.com>
2019-11-12 15:58:34 +00:00
Nick Desaulniers
bcbeb438ad Merge "bionic: libc: remove -Wimplicit-fallthrough"
am: ebe5bfefe1

Change-Id: I85c588d51d4c3edc7da7b5e4e62e364c404a181b
2019-11-11 14:04:52 -08:00
Treehugger Robot
ebe5bfefe1 Merge "bionic: libc: remove -Wimplicit-fallthrough" 2019-11-11 21:32:43 +00:00
Daniel Colascione
0cf90556de Make system property reads wait-free
Right now, when we read a system property, we first (assuming we've
already looked up the property's prop_info) read the property's serial
number; if we find that the low bit (the dirty bit) in the serial
number is set, we futex-wait for that serial number to become
non-dirty. By doing so, we spare readers from seeing partially-updated
property values if they race with the property service's non-atomic
memcpy to the property value slot. (The futex-wait here isn't
essential to the algorithm: spinning while dirty would suffice,
although it'd be somewhat less efficient.)

The problem with this approach is that readers can wait on the
property service process, potentially causing delays due to scheduling
variance. Property reads are not guaranteed to complete in finite time
right now.

This change makes property reads wait-free and ensures that they
complete in finite time in all cases. In the new approach, we prevent
value tearing by backing up each property we're about to modify and
directing readers to the backup copy if they try to read a property
with the dirty bit set.

(The wait freedom is limited to the case of readers racing against
*one* property update. A writer can still delay readers by rapidly
updating a property --- but after this change, readers can't hang due
to PID 1 scheduling delays.)

I considered adding explicit atomic access to short property values,
but between binary compatibility with the existing property database
and the need to carefully handle transitions of property values
between "short" (compatible with atomics) and "long" (incompatible
with atomics) length domains, I figured the complexity wasn't worth it
and that making property reads wait-free would be adequate.

Test: boots
Bug: 143561649
Change-Id: Ifd3108aedba5a4b157b66af6ca0a4ed084bd5982
2019-11-11 11:17:00 -08:00
Nick Desaulniers
97c43095b9 bionic: libc: remove -Wimplicit-fallthrough
aosp/144287300 set it to a global cppflag.

The compiler upgrade can now check for this warning in C code.

This patch should be reverted once the BSD sources with instances of
-Wimplicit-fallthrough have been fixed.

Remove it from cflags, so that it's not re-enabled for C code until
fixed.

Bug: 139945549
Bug: 144287300
Test: mm
Change-Id: Ieca0d5b41634636477392e5209a41807f9b44bd4
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-11 10:49:10 -08:00
Josh Gao
45f47e0e44 Merge "linker: add more context to link failure error."
am: 28fb781ef7

Change-Id: I8371941b83821ee7ca576ed69fadcd1734736ee9
2019-11-08 16:21:14 -08:00
Treehugger Robot
28fb781ef7 Merge "linker: add more context to link failure error." 2019-11-09 00:13:31 +00:00
Elliott Hughes
d63b56bf89 Merge "Stop using __out as a name."
am: ffad55954b

Change-Id: I8b7c9ac99ef6f4996a5b88f2fc2e45e693199cc4
2019-11-08 15:41:48 -08:00
Treehugger Robot
ffad55954b Merge "Stop using __out as a name." 2019-11-08 23:25:19 +00:00
Christopher Ferris
054e5d45c2 Merge "Rename iterate to malloc_iterate internally."
am: c686ab54c2

Change-Id: Ibe938c06d199011e9a2d2d499ae9a652c0ee050a
2019-11-08 14:31:26 -08:00
Christopher Ferris
c686ab54c2 Merge "Rename iterate to malloc_iterate internally." 2019-11-08 22:10:56 +00:00
Elliott Hughes
f38e8ca149 Stop using __out as a name.
libc++ poisons `__out` because it's #defined on Windows. Rather than
hack libc++, let's just avoid that name. "src" and "dst" are far more
widely used than "in" and "out" for this purpose anyway.

Test: treehugger
Change-Id: I0db9997fd5f06f626dbf0ee967b52145395466b4
2019-11-08 13:51:12 -08:00
Christopher Ferris
6f517cd7a1 Rename iterate to malloc_iterate internally.
I have no idea why I used the iterate name internally which is
completely unlike every other function name. Change this to match
everyone else so that it's now malloc_iterate everywhere.

This is probably the last chance to change this before mainline
modules begin, so make everything consistent.

Test: Compiles, unit tests passes.
Change-Id: I56d293377fa0fe1a3dc3dd85d6432f877cc2003c
2019-11-08 11:49:14 -08:00
Martin Stjernholm
433e81776f Merge "Revert submission of topic 'libdl_android-in-apex'"
am: 31600e8424

Change-Id: Iac424e588e1c6a9092939e219871776567f37335
2019-11-08 04:05:56 -08:00
Martin Stjernholm
31600e8424 Merge "Revert submission of topic 'libdl_android-in-apex'" 2019-11-08 11:51:39 +00:00
Yuexi Ma
c74666eb3c Revert submission of topic 'libdl_android-in-apex'
Reason for revert: broke numerous major apps in app compat testing
Bug: 144100240

Change-Id: I50b440356bdbde3ac130da5d28d5ef20f8b63582
2019-11-07 19:18:53 +00:00
Jim Blackler
23ced37112 Merge "Revert "fortify: allow diagnostics without run-time checks""
am: ca1834de7a

Change-Id: Iccd3f1349aabbb7a83b177a503ecca75d645b860
2019-11-07 04:48:38 -08:00
Jim Blackler
ca1834de7a Merge "Revert "fortify: allow diagnostics without run-time checks"" 2019-11-07 12:39:16 +00:00
Jim Blackler
2a83cb7357 Revert "fortify: allow diagnostics without run-time checks"
This reverts commit d7e11b8853.

Reason for revert: Droidcop-triggered revert due to breakage android-build.googleplex.com/builds/submitted/5992686/aosp_x86_64-eng/latest/view/logs/build_error.log, bug b/144081298

Change-Id: Ic6a492c4fcf2ea1bb324c44fb615a898bbc9a9b7
2019-11-07 12:21:47 +00:00
Martin Stjernholm
de246b2318 Merge "Add libdl_android to the Runtime APEX."
am: 77e910d337

Change-Id: I20753896e8e08ef34db9bae99c249b4a3ded8aea
2019-11-07 03:10:19 -08:00
Martin Stjernholm
77e910d337 Merge "Add libdl_android to the Runtime APEX." 2019-11-07 11:01:36 +00:00
George Burgess IV
03d2fc3ce3 Merge "Revert "fortify: allow diagnostics without run-time checks""
am: 2fead5fd89

Change-Id: Ic15e46a2e9cc1fb794350ad2996809a0f45e14d7
2019-11-06 23:19:17 -08:00
George Burgess IV
2fead5fd89 Merge "Revert "fortify: allow diagnostics without run-time checks"" 2019-11-07 07:10:38 +00:00
George Burgess IV
f359548bf1 Revert "fortify: allow diagnostics without run-time checks"
This reverts commit d7e11b8853.

Reason for revert: Breaks aosp_x86_64-eng. Will look into it and
unbreak when it's not almost midnight. :)

Change-Id: I21f76efe4d19c70d0b14630e441376d359a45b49
2019-11-07 07:07:38 +00:00
Elliott Hughes
3e16696e3a Merge "Restore _FORTIFY_SOURCE in versioner."
am: 03aa94c9a9

Change-Id: I9a278309918c764a74b16b97b7056a22b3c191d3
2019-11-06 18:57:55 -08:00
Treehugger Robot
03aa94c9a9 Merge "Restore _FORTIFY_SOURCE in versioner." 2019-11-07 02:42:58 +00:00
George Burgess IV
b5723ceadc Merge "fortify: allow diagnostics without run-time checks"
am: d1dcb72882

Change-Id: Ieb616393b86be68d4f2d58f157f6d5a00ee5dafb
2019-11-06 17:51:46 -08:00
Treehugger Robot
d1dcb72882 Merge "fortify: allow diagnostics without run-time checks" 2019-11-07 01:34:11 +00:00
Christopher Ferris
4d0677ffa8 Merge "Fix allocations escaping malloc debug."
am: 7a3a5d8cd7

Change-Id: Iea20e640edb0a289b57b2835f171765636cc5c20
2019-11-06 15:48:20 -08:00
Christopher Ferris
7a3a5d8cd7 Merge "Fix allocations escaping malloc debug." 2019-11-06 23:31:33 +00:00
Elliott Hughes
f7db8507ee Restore _FORTIFY_SOURCE in versioner.
Bug: http://b/118991081
Test: treehugger
Change-Id: I2818d8c27ecc5a48666013cdd0eaa26ec7900688
2019-11-06 14:35:34 -08:00
Tom Cherry
f46a41349e Merge changes I01d061c4,I2e3f6ee7
am: b18158c3c9

Change-Id: Ia4986a27a679a205a8b8e1493d993ca3abbe08a1
2019-11-06 14:03:17 -08:00
Tom Cherry
b18158c3c9 Merge changes I01d061c4,I2e3f6ee7
* changes:
  Check that __system_property_set() doesn't leak FDs
  clang-format: Add IncludeBlocks: Preserve
2019-11-06 21:54:00 +00:00
Ryan Prichard
6b7a6088f3 Merge "linker: avoid -O0 memset while clearing temp_tcb"
am: ca0d8990d3

Change-Id: I5d8bf9893462769495321b309eb4eaf9e555b1a6
2019-11-06 12:55:24 -08:00
Ryan Prichard
ca0d8990d3 Merge "linker: avoid -O0 memset while clearing temp_tcb" 2019-11-06 20:38:30 +00:00
Christopher Ferris
ff88fb0d3a Fix allocations escaping malloc debug.
When using a FILE object for some malloc debug functions, calling
fprintf will trigger an allocation to be put in the object. The problem
is that these allocations were not allocated by the malloc debug
wrapper and they get freed during the fclose as if they are malloc
debug allocation. In most cases, the code will detect the bad pointer
and leak the memory, but it might also cause a crash.

The fix is to avoid using fprintf so that no allocations are made
in the object that survive and need to be freed in the fclose call.

Change the MallocXmlElem.h to use a file decsriptor not a FILE object.

Add new unit and system tests to detect this case.

Bug: 143742907

Test: Ran unit and system tests.
Test: Ran bionic unit tests.
Change-Id: I524392de822a29483aa5be8f14c680e70033eba2
2019-11-06 10:42:42 -08:00
Elliott Hughes
5e3d13037e Merge "android_getaddrinfo_proxy: fix memory leak on failure."
am: d9585a2196

Change-Id: Ieaba9902105043a251cb85c5fefa1ff2716390be
2019-11-06 09:49:15 -08:00
Elliott Hughes
d9585a2196 Merge "android_getaddrinfo_proxy: fix memory leak on failure." 2019-11-06 17:31:14 +00:00
Elliott Hughes
19ce487d00 Merge "Limit threads in pthread_leak#detach for low power devices."
am: 9a09137b0e

Change-Id: Iea7ee60988fd37e61e63b35e6e6cca0b2e12f590
2019-11-06 08:11:10 -08:00
Elliott Hughes
9a09137b0e Merge "Limit threads in pthread_leak#detach for low power devices." 2019-11-06 16:00:48 +00:00