Commit graph

27483 commits

Author SHA1 Message Date
Haibo Huang
7bd54ade8d Merge "libc: Optimize ARM memcmp by using NEON." 2018-12-22 04:54:23 +00:00
Kyle Repinski
78da73adad libc: Optimize ARM memcmp by using NEON.
Because NEON_UNALIGNED_ACCESS has never been defined, it has gone unused.
This change enables NEON optimization if __ARM_NEON__ is defined.

Test: bionic-benchmarks-32 BM_string_memcmp

On Nextbit Robin (MSM8992), here are the results

Before:
                                       iterations      ns/op
BM_string_memcmp/8                            50M         28    0.277 GiB/s
BM_string_memcmp/64                           50M         54    1.169 GiB/s
BM_string_memcmp/512                           5M        444    1.151 GiB/s
BM_string_memcmp/1024                          2M        885    1.156 GiB/s
BM_string_memcmp/8Ki                         200k       7401    1.107 GiB/s
BM_string_memcmp/16Ki                        200k      14469    1.132 GiB/s
BM_string_memcmp/32Ki                        100k      28726    1.141 GiB/s
BM_string_memcmp/64Ki                         50k      57480    1.140 GiB/s

After:
                                       iterations      ns/op
BM_string_memcmp/8                            50M         22    0.351 GiB/s
BM_string_memcmp/64                         1000k         17    3.688 GiB/s
BM_string_memcmp/512                          20M        105    4.848 GiB/s
BM_string_memcmp/1024                         10M        190    5.367 GiB/s
BM_string_memcmp/8Ki                        1000k       1496    5.475 GiB/s
BM_string_memcmp/16Ki                       1000k       2746    5.966 GiB/s
BM_string_memcmp/32Ki                        500k       5481    5.978 GiB/s
BM_string_memcmp/64Ki                        200k      10971    5.973 GiB/s

Change-Id: I3c76ce7fa2796872e0171d5502b0ebd6e2893339
2018-12-22 01:04:27 +00:00
Florian Mayer
3a538a4861 Do not run heapprofd_initialize twice concurrently.
Change-Id: Ib3fd479ca690c90ca35d98386a1d3ec942715fa3
2018-12-20 11:31:02 +00:00
Christopher Ferris
0ec6aa0f22 Merge "Fix handling of libs with a ro map and a rx map." 2018-12-19 18:14:15 +00:00
Christopher Ferris
b233fab925 Fix handling of libs with a ro map and a rx map.
When the linker was changed so that it put a read-only map and
read-execute map, this code incorrectly computed the relative pc and
offset. Modify to look for the actual start map in this case.

Also, change the load_base name to load_bias.

Bug: 120613266

Test: Dumped logcat while dumping backtraces.

Change-Id: I6628694c5222ea34d63217af3d138707d4900004
2018-12-18 17:45:46 -08:00
Elliott Hughes
727a6ebcfb Merge "Make stdlib.getloadavg more resiliant." 2018-12-19 01:33:36 +00:00
Elliott Hughes
3b3e09aad0 Merge "Fix sys_prctl.pr_cap_ambient." 2018-12-19 01:32:39 +00:00
Elliott Hughes
910a2a83a4 Fix sys_prctl.pr_cap_ambient.
This test didn't clear errno before testing it, so was sensitive to
whatever code had run before. Since I'd already added the code to dump
the exact kernel version before realizing the actual bug, I've left that
in too.

Bug: http://b/121156651
Test: ran tests
Change-Id: I38482036cb6f035c0c98c27eb64d17829f29b09a
2018-12-18 15:19:40 -08:00
Elliott Hughes
72a54a41a7 Make stdlib.getloadavg more resiliant.
Using rint(3) gave us a step where if one side was 1.4 and the other
was 1.5, that would be 1 and 2 respectively. So instead use a simple
difference. Also log more detail in case this doesn't fix the flakiness.

Bug: http://b/121156651
Test: ran tests
Change-Id: Ib5b2eb05d2b1eb8c4a10b182a8703510a3ef0cea
2018-12-18 14:47:25 -08:00
Elliott Hughes
0c499a69e3 Merge "Generate the per-arch .map files at build time." 2018-12-18 19:21:01 +00:00
Treehugger Robot
22549b331c Merge "Increase 2ms to 5ms to reduce flake." 2018-12-18 16:34:46 +00:00
Elliott Hughes
0dafa8a3a5 Increase 2ms to 5ms to reduce flake.
Bug: http://b/121156651
Test: ran tests
Change-Id: Ief699cacf920b144bf66821cf0ac73930fae9274
2018-12-17 16:04:45 -08:00
Elliott Hughes
d19b3c5274 Generate the per-arch .map files at build time.
We shouldn't be checking in these generated files...

Bug: N/A
Test: ran tests
Change-Id: Ib67c1ba839eacd7acebd713e1dcd4dd2c25d67f0
2018-12-17 12:26:42 -08:00
Vic Yang
9ea997a2ac Merge "Further improve of linker memory allocators" 2018-12-14 00:56:56 +00:00
Vic Yang
2bbd49be84 Merge "Reduce LinkerSmallObjectAllocator memory overhead" 2018-12-14 00:56:33 +00:00
Treehugger Robot
1e10cdc916 Merge "Suppress cert-dcl16-c clang-tidy warnings" 2018-12-13 21:38:14 +00:00
Chih-Hung Hsieh
37a2e61133 Suppress cert-dcl16-c clang-tidy warnings
Bug: 120614316
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,cert-dcl16-c
Change-Id: Iab21f41806d81268ebc13bb9605920b4b8e825c9
2018-12-13 11:49:34 -08:00
Haibo Huang
c87fb3ed82 Merge "No ifunc for strcmp and strlen" 2018-12-13 19:23:08 +00:00
Vic Yang
259429bd85 Further improve of linker memory allocators
This includes:
  - Blocks allocated by small object allocators are now aligned to
    their block size.
  - Remove redundant free_blocks_cnt and allocated_blocks_cnt, as they
    sum up to a fixed number.
  - Remove a redundant padding word in small_object_page_info on 32-bit
    platform.

Test: Build and boot cuttlefish.
Change-Id: Ib922d7af739e3709e8a162c7f68e7f99bf95a914
2018-12-12 17:39:07 -08:00
Vic Yang
5493851e1b Reduce LinkerSmallObjectAllocator memory overhead
The current implementation of LinkerSmallObjectAllocator keeps record
of pages in a vector, which uses its own page(s).  This is at least a
page overhead per LinkerSmallObjectAllocator.

This change removes the page record vector by managing the pages in a
doubly linked list.

We also fix a bug where we are actually keeping up to 2 free pages
instead of just one.

The memory used by small objects when running 'dd', before this change:
    72 KB  [anon:linker_alloc_small_objects]
    28 KB  [anon:linker_alloc_vector]

After this change:
    60 KB  [anon:linker_alloc_small_objects]

Test: Boot cuttlefish and check memory used by linker.
Change-Id: I3468fa4d853c78b4bc02bfb84a3531653f74fb17
2018-12-12 15:53:55 -08:00
Haibo Huang
e4788d4c7e No ifunc for strcmp and strlen
This is a workaround to unbreak bank apps

Bug: 120254692
Test: Run broken apps
Change-Id: I47a655e9648a6d5f50856f712d8e1cf2be24b440
2018-12-12 04:28:29 +00:00
Chih-hung Hsieh
c49776bffc Merge "Fix cert-dcl16-c clang-tidy warnings in tests." 2018-12-12 03:00:08 +00:00
Ryan Prichard
b0a55fbf74 Merge "Reserve TLS_SLOT_SANITIZER with value 6." 2018-12-12 02:02:03 +00:00
Chih-Hung Hsieh
c2edae3f86 Fix cert-dcl16-c clang-tidy warnings in tests.
Bug: 120614316
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,cert-dcl16-c
Change-Id: I2606dc4cdfff9c2691ed60d529971e16adb3a9ae
2018-12-11 15:16:24 -08:00
Ryan Prichard
913f808c0f Merge "Move errno to a pthread_internal_t field." 2018-12-11 22:35:16 +00:00
Treehugger Robot
7c2c34cb24 Merge "Fix performance-for-range-copy warnings" 2018-12-11 21:11:53 +00:00
Ryan Prichard
4825c6d814 Reserve TLS_SLOT_SANITIZER with value 6.
This slot will replace TLS_SLOT_TSAN, which needs to be removed for ELF
TLS compatibility. The platform has both slots reserved until compiler-rt
can be updated. See:
 - https://reviews.llvm.org/D53906
 - discussion on AOSP change Idf25d2ee457a5d26d0bdd6281cee72c345c8b755

Bug: http://b/78026329
Test: m
Change-Id: Ifd5aeb5711dc88266e7350cb022146dd87cfd7be
2018-12-11 13:02:56 -08:00
Ryan Prichard
37754cdef6 Move errno to a pthread_internal_t field.
This change is intended to allow native-bridge to use independent
TLS memory for host and guest environments, while still sharing a
thread-local errno between the two.

Bug: http://b/78026329
Test: bionic unit tests
Change-Id: I838cd321e159add60760bc12a8aa7e9ddc960c33
Merged-In: I838cd321e159add60760bc12a8aa7e9ddc960c33
(cherry picked from commit a9c7c55462)
2018-12-11 12:59:23 -08:00
Neil Fuller
24bddbe949 Merge "Revert "Track movement of ICU .dat file"" 2018-12-11 20:20:14 +00:00
Neil Fuller
b9e7b699a2 Revert "Track movement of ICU .dat file"
This reverts commit 68c6bd8b43.

Reason for revert: Broke ART test environments and emulator devices.

Bug: 119293618
Change-Id: I1b0531d13c6565ce83801d93c78813af592eec1a
2018-12-11 20:11:58 +00:00
Chih-Hung Hsieh
0218e92329 Fix performance-for-range-copy warnings
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I41cc70d161468c5586ca8be3185578e65681a9c5
2018-12-11 10:22:11 -08:00
Neil Fuller
681d8eb5ca Merge "Track movement of ICU .dat file" 2018-12-11 14:03:28 +00:00
Neil Fuller
2f1a8dbd10 Merge "Find tzdata in the runtime module before /system" 2018-12-10 17:37:33 +00:00
Neil Fuller
68c6bd8b43 Track movement of ICU .dat file
Track movement of ICU .dat file into the runtime module.

Bug: 119293618
Test: build / boot
Change-Id: I595c0c94ea7f693810fbe323d7966d9fdf4a07e6
2018-12-09 15:01:43 +00:00
Neil Fuller
4e33c4ff9b Merge "Track move of APEX module tz files under etc/tz" 2018-12-08 16:41:48 +00:00
Treehugger Robot
b0f293ce52 Merge "DO NOT MERGE" 2018-12-08 04:20:32 +00:00
Xin Li
efea995eb4 DO NOT MERGE
Merge pie-platform-release (PPRL.181205.001, history only) into master

Bug: 120502534
Change-Id: I4d8ac790868a56f65fd9805d06646a15918f4657
2018-12-07 17:47:18 -08:00
Neil Fuller
a50e51ac96 Find tzdata in the runtime module before /system
Look for the tzdata file in the runtime module before looking
in /system. It is still an open question how the removal of
tzdata will be handled, if at all. Until it is worked out it
will be duplicated.

Bug: 119293618
Bug: 119390260
Test: build / boot
Change-Id: I7e14ef41d0ec226caa595c56be61df5ecf50c382
2018-12-07 09:14:03 +00:00
Ryan Prichard
8b475e598d Merge "Move dlerror out of a TLS slot and into a pthread_internal_t member." 2018-12-06 22:18:56 +00:00
Roland Levillain
42635c98a1 Merge "Add Android Runtime APEX bin directory to Bionic default shell search path." 2018-12-06 17:13:06 +00:00
Roland Levillain
fe21bbacfc Add Android Runtime APEX bin directory to Bionic default shell search path.
Insert `/apex/com.android.runtime/bin` before `/system/bin` in the
default shell search path (`_PATH_DEFPATH`).

Test: Device boot test with Android Runtime APEX.
Test: Device boot test without Android Runtime APEX.
Test: cts-tradefed run cts --m vm-tests-tf
Test: cts-tradefed run cts --m CtsSimpleperfTestCases
Test: adb root && cts-tradefed run cts --m CtsBionicTestCases
Bug: 113373927
Bug: 119949783
Change-Id: I45fd6ccb939c7e99eb6bda740a7187774c1e930d
2018-12-06 17:03:47 +00:00
Dimitry Ivanov
5c92d9e858 Merge "Introduce filegroups for libc sources" 2018-12-06 14:39:30 +00:00
Neil Fuller
9268977f2d Track move of APEX module tz files under etc/tz
The same prebuilts will be used in both runtime and time zone
modules. Having the rules put the files in etc/tz/ will make
them more appropriate for the runtime module.

Bug: 119026403
Test: build /boot only
Change-Id: Ia1370457e9d1547b35ed56bb385213d3727c8b9a
2018-12-06 14:33:12 +00:00
Elliott Hughes
34583c1089 Move dlerror out of a TLS slot and into a pthread_internal_t member.
Bug: N/A
Test: boots, tests pass.
Change-Id: Idf25d2ee457a5d26d0bdd6281cee72c345c8b755
2018-12-06 05:19:57 +00:00
Treehugger Robot
31105c8dd8 Merge "Remove cruft." 2018-12-06 02:43:58 +00:00
Ryan Prichard
a6bc0e3c28 Merge changes I96c7b02c,I461feeae,I6fcd8d75
* changes:
  Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals
  Use shared globals so getauxval works earlier
  Split main thread init into early+late functions
2018-12-05 20:46:15 +00:00
Chih-hung Hsieh
b071f27a4f Merge "Revert "Work around bugprone-exception-escape bug."" 2018-12-05 19:14:54 +00:00
Elliott Hughes
9131b4abfd Remove cruft.
Test: builds
Change-Id: I432d97ca9c94d96eba74687338d27c0f41b71f0c
2018-12-05 10:00:25 -08:00
dimitry
c0c0ef6da6 Introduce filegroups for libc sources
Add filegroups for libc sources not included in component static
libraries.

Bug: http://b/120406045
Bug: http://b/114470065
Test: make
Change-Id: I2045f14d6636e0da4eb741bfd2de3312475e20e3
2018-12-05 16:37:13 +01:00
Treehugger Robot
aabebb2772 Merge "Bionic: Support kryo385 CPU" 2018-12-05 07:50:39 +00:00