Skip to content
Snippets Groups Projects
  1. Apr 15, 2019
  2. Apr 08, 2019
  3. Mar 29, 2019
  4. Mar 28, 2019
  5. Feb 15, 2019
  6. Feb 14, 2019
    • Benoît Lizé's avatar
      blink/bindings: Use PartitionAlloc for zlib's temporary data. · 7b942973
      Benoît Lizé authored
      zlib uses malloc() to allocate temporary data. Unfortunately, on Android,
      jemalloc (malloc()'s underlying implementation) caches temporary data after
      free() in a thread-local cache. As renderers don't allocate from malloc() often
      in background threads, this data is not reclaimed. This increases memory usage
      by up to 256kiB per background compression thread, which is the cause for a
      sizable malloc() memory regression from foreground string compression (see
      linked bug).
      
      The deeper reason for the regression is more complex, see details in the linked
      bug, and
      https://docs.google.com/document/d/1aRIifaHF5l9relq9vHirTOWt2AZoAkDNqHiYZrWGE9A/edit?usp=sharing
      
      It involves some interaction between:
      - jemalloc implementation and memory accounting
      - Android's configuration of jemalloc
      - Chrome's allocation and threading patterns
      - zlib's allocation patterns
      
      Nevertheless, the regression is real, and to mitigate it, use PartitionAlloc to
      allocate zlib's temporary data.
      
      This is not necessary for decompression, as the allocation patterns are not the
      same, and the main thread doesn't have the same issues. As such, only do it for
      compression, to avoid a needlessly complex CL.
      
      On PartitionAlloc vs malloc():
      The only path using partition alloc in this CL in from the renderer process,
      where it is already widely used. The issue is less likely to appear in the
      browser process as malloc() is more widely used there, though further
      investigation may reveal issues.
      
      Android vs everywhere:
      The issue is present at least with jemalloc(), that is Android. However thread
      caches and arena-allocators are used on other platforms as well, and as the
      allocation is not performance-sensitive, using PartitionAlloc everwhere makes
      the code simpler, and protects against potential issues (as we know that this
      specific issue does not arise with PartitionAlloc).
      
      Bug: 931553, 924164
      Change-Id: I9e94e9cea5d51fac67b04fdb1681427e57bfbe1f
      Reviewed-on: https://chromium-review.googlesource.com/c/1472578
      
      
      Commit-Queue: Benoit L <lizeb@chromium.org>
      Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
      Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#632372}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: 5e7e1b1967f6d36206d0f18bcf25d99041bfdc37
      7b942973
  7. Feb 13, 2019
    • Noel Gordon's avatar
      [zlib_bench] improve program options handling · 7fc69a35
      Noel Gordon authored
      The program options handling has grown a little weedy. Add get_options
      helper. The wrapper (gzip|zlib|raw) is a required arg, not an optional
      arg, so remove --wrapper. Limit the --compression level to [1-9] since
      0 causes compression failure in practice. Use Z_DEFAULT_COMPRESSION if
      --compression is not given (zlib@6). Make the compression_level static
      global since it is a program-level constant. Update usage helper.
      
      Bug: 798943
      Change-Id: I8e19bd029c1163a00a1b6a2a252c1a4e5da1a633
      Reviewed-on: https://chromium-review.googlesource.com/c/1460242
      
      
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Commit-Queue: Noel Gordon <noel@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#631624}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: 74c7f46559047433d694f20cf574815bfa4cb8a6
      7fc69a35
  8. Jan 31, 2019
  9. Jan 11, 2019
  10. Jan 08, 2019
  11. Jan 02, 2019
  12. Dec 20, 2018
    • Monica Salama's avatar
      Avoid uncompressing if uncompressed size is too big. · 2aafd9d3
      Monica Salama authored
      The uncompressed size might be unreasonable in case the data we
      uncompress with GzipUncompress does not have the right format or is
      corrupted which will lead to resize to attempt to throw an exception.
      
      The two possible exceptions from resize() are length_error and
      bad_alloc. In case the exception attempted is length_error (which I
      assumed based on that the error reported is Xlength_error) checking
      for std::string::max_size() would avoid such a crash.
      
      Bug: 911865
      Change-Id: Ida8f845c1334ef0097765d168c19034c6ca00cc0
      Reviewed-on: https://chromium-review.googlesource.com/c/1380035
      
      
      Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
      Commit-Queue: Monica Salama <msalama@google.com>
      Cr-Original-Commit-Position: refs/heads/master@{#618224}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: 322bc779d3bf6945bf646caa437b90fc59e8ff8c
      2aafd9d3
  13. Dec 13, 2018
  14. Dec 07, 2018
  15. Nov 21, 2018
  16. Nov 16, 2018
  17. Nov 14, 2018
  18. Oct 31, 2018
  19. Oct 01, 2018
    • Daniel Bratell's avatar
      Resolve Windows conflict between zlib and angle · c44fb724
      Daniel Bratell authored
      Windows normally defines macros so that FAR expands to far, and
      far expands to nothing.
      
      Angle undefs far, leaving the FAR macro hanging, expanding to far
      which is not a legal keyword anymore. zlib already tries to handle
      that someone/something has undefined FAR but it doesn't handle
      that someone/something has undefined far. This patch changes that.
      
      This problem appeared in some jumbo builds in
      gpu/command_buffer/service which uses both angle and zlib.
      
      Bug: 889429
      Change-Id: Ia3b10a9a82fc51b302c67b24a19f30a73bdda489
      Reviewed-on: https://chromium-review.googlesource.com/1245723
      
      
      Commit-Queue: Daniel Bratell <bratell@opera.com>
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#595425}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: ed040aad80066a3799a7c07c25154577fc929f86
      c44fb724
  20. Sep 20, 2018
    • Mike Klein's avatar
      remove 16-byte alignment from deflate_state::crc0 · ea3ba903
      Mike Klein authored
      We noticed recently on the Skia tree that if we build Chromium's zlib
      with GCC, -O3, -m32, and -msse2, deflateInit2_() crashes.  Might also
      need -fPIC... not sure.
      
      I tracked this down to a `movaps` (16-byte aligned store) to an address
      that was only 8-byte aligned.  This address was somewhere in the middle
      of the deflate_state struct that deflateInit2_()'s job is to initialize.
      
      That deflate_state struct `s` is allocated using ZALLOC, which calls any
      user supplied zalloc if set, or the default if not.  Neither one of
      these has any special alignment contract, so generally they'll tend to
      be 2*sizeof(void*) aligned.  On 32-bit builds, that's 8-byte aligned.
      
      But because we've annotated crc0 as zalign(16), the natural alignment of
      the whole struct is 16-byte, and a compiler like GCC can feel free to
      use 16-byte aligned stores to parts of the struct that are 16-byte
      aligned, like the beginning, crc0, or any other part before or after
      crc0 that happens to fall on a 16-byte boundary.  With -O3 and -msse2,
      GCC does exactly that, writing a few of the fields with one 16-byte
      store.
      
      The fix is simply to remove zalign(16).  All the code that manipulates
      this field was actually already using unaligned loads and stores.  You
      can see it all right at the top of crc_folding.c, CRC_LOAD and CRC_SAVE.
      
      This bug comes from the Intel performance patches we landed a few years
      ago, and isn't present in upstream zlib, Android's zlib, or Google's
      internal zlib.
      
      It doesn't seem to be tickled by Clang, and won't happen on 64-bit GCC
      builds: zalloc is likely 16-byte aligned there.  I _think_ it's possible
      for it to trigger on non-x86 32-bit builds with GCC, but haven't tested
      that.  I also have not tested MSVC.
      
      The moved comment is entirely to appease git cl format.
      
      Change-Id: Ie2d8eb9ddefa1e35e6d21ee4b29797f6949b0687
      Reviewed-on: https://chromium-review.googlesource.com/1236613
      
      
      Reviewed-by: default avatarLeon Scroggins <scroggo@chromium.org>
      Commit-Queue: Mike Klein <mtklein@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#592930}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: da63534faf202b7d31ddfd37078d0a5e60113e38
      ea3ba903
  21. Sep 04, 2018
  22. Aug 23, 2018
  23. Aug 22, 2018
  24. Aug 17, 2018
  25. Aug 15, 2018
  26. Aug 07, 2018
  27. Aug 06, 2018
  28. Jul 18, 2018
  29. May 30, 2018
  30. May 07, 2018
    • Avi Drissman's avatar
      Fully move PathService into the base namespace. · da0819d6
      Avi Drissman authored
      BUG=838398
      
      Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_compile_x64_dbg;master.tryserver.chromium.android:android_compile_x86_dbg;master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.linux:linux_mojo;master.tryserver.chromium.linux:linux_vr;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.win:win10_chromium_x64_rel_ng
      Change-Id: Ibb79d0d8090cece52d7a20269153718992c8c2d1
      Reviewed-on: https://chromium-review.googlesource.com/1036570
      
      
      Commit-Queue: Avi Drissman <avi@chromium.org>
      Reviewed-by: default avatarWill Harris <wfh@chromium.org>
      Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#556512}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: ea15ea06b514d9a95af39d7e35235fdf948da0c8
      da0819d6
  31. May 02, 2018
  32. Apr 04, 2018
  33. Mar 27, 2018
  34. Mar 14, 2018
  35. Feb 22, 2018
  36. Feb 16, 2018
    • Adenilson Cavalcanti's avatar
      Compute crc32 using ARMv8 specific instruction · 72356729
      Adenilson Cavalcanti authored
      CRC32 affects performance for both image decoding (PNG)
      as also in general browsing while accessing websites that serve
      content using compression (i.e. Content-Encoding: gzip).
      
      This patch implements an optimized CRC32 function using the
      dedicated instruction available in ARMv8a. We only support
      ARM Little-Endian (LE).
      
      This instruction is available in new Android devices featuring an
      ARMv8 SoC, like Nexus 5x and Google Pixel. It should be between
      3x (A72) to 7x faster (A53) than the C implementation currently used
      by zlib for 8KB vectors.
      
      This is performance critical code and can be called with both large (8KB)
      or small vectors, therefore we must avoid extraneous function calls or
      branching (otherwise the performance benefits are negated). So the use
      of 'public' variables to read the CPU features status flags
      (i.e. arm_cpu_enable_crc32 | pmull).
      
      Finally it also introduces code to perform run-time ARM CPU feature
      detection on the supported platforms: Android and Linux/CrOS. We build
      and link the CRC32 instruction dependent code, but will decide to use it
      at run-time if the ARM CPU supports the CRC32 instruction. Otherwise,
      we fallback to using zlib's default C implementation.
      
      This approach allows to use the instruction in both 32bits and 64bits and
      works fine either in ARMv7 or ARMv8 processor. I tested the generated
      Chrome apk in both a Nexus 6 (ARMv7) and a Google Pixel (ARMv8).
      
      The crc32 function benefited from input from Yang Zang and Mike Klein,
      while the arm_features benefited from input from Noel Gordon.
      
      Bug: 709716
      Change-Id: I315c1216f8b3a8d88607630a28737c41f52a2f5d
      Reviewed-on: https://chromium-review.googlesource.com/801108
      
      
      Reviewed-by: default avatarChris Blume <cblume@chromium.org>
      Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
      Commit-Queue: Noel Gordon <noel@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#537179}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: 28c9623083688b3a354c33bf77746f4c51f58826
      72356729
  37. Feb 13, 2018
Loading