[all-commits] [llvm/llvm-project] 27dc24: [scudo] Add partial chunk heuristic to retrieval a...

Joshua Baehring via All-commits all-commits at lists.llvm.org
Mon Aug 19 18:03:56 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 27dc247964472aaf92ea55cc37310cda25a002ab
      https://github.com/llvm/llvm-project/commit/27dc247964472aaf92ea55cc37310cda25a002ab
  Author: Joshua Baehring <98630690+JoshuaMBa at users.noreply.github.com>
  Date:   2024-08-19 (Mon, 19 Aug 2024)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/secondary.h
    M compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp

  Log Message:
  -----------
  [scudo] Add partial chunk heuristic to retrieval algorithm. (#104807)

Previously the secondary cache retrieval algorithm would not allow
retrievals of memory chunks where the number of unused bytes would be
greater than than `MaxUnusedCachePages * PageSize` bytes. This meant
that even if a memory chunk satisfied the requirements of the optimal
fit algorithm, it may not be returned. This remains true if memory
tagging is enabled. However, if memory tagging is disabled, a new
heuristic has been put in place. Specifically, If a memory chunk is a
non-optimal fit, the cache retrieval algorithm will attempt to release
the excess memory to force a cache hit while keeping RSS down.

In the event that a memory chunk is a non-optimal fit, the retrieval
algorithm will release excess memory as long as the amount of memory to
be released is less than or equal to 16 KB. If the amount of memory to
be released exceeds 16 KB, the retrieval algorithm will not consider
that cached memory chunk valid for retrieval.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list