[all-commits] [llvm/llvm-project] 5f771c: [scudo] Support dumping fragmentation data in Size...

ChiaHungDuan via All-commits all-commits at lists.llvm.org
Mon Aug 21 10:29:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f771c9936b828d5fc017ad558e84702500df99c
      https://github.com/llvm/llvm-project/commit/5f771c9936b828d5fc017ad558e84702500df99c
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2023-08-21 (Mon, 21 Aug 2023)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/primary32.h
    M compiler-rt/lib/scudo/standalone/primary64.h
    M compiler-rt/lib/scudo/standalone/release.h
    M compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
    M compiler-rt/lib/scudo/standalone/wrappers_c.inc

  Log Message:
  -----------
  [scudo] Support dumping fragmentation data in SizeClassAllocator64

This tells the number of pages that still have blocks in-used, i.e.,
those pages can't do releaseToOSMaybe(). Along with the information of
getStats() and RSS usage from the system (like smaps), we can tell if
the heuristic in releaseToOSMaybe() works well in certain scenarios.

Here's the sample output:
```
    Fragmentation Stats: SizeClassAllocator64: page size = 4096
      01 (    32): inuse/total blocks:    275/   416 inuse/total pages:      4/     4 inuse bytes:     16K
      02 (    48): inuse/total blocks:    182/   312 inuse/total pages:      4/     4 inuse bytes:     16K
      03 (    64): inuse/total blocks:    169/   312 inuse/total pages:      5/     5 inuse bytes:     20K
      ...
      32 (  1040): inuse/total blocks:     90/   152 inuse/total pages:     37/    39 inuse bytes:    148K
      33 (  1168): inuse/total blocks:    136/   232 inuse/total pages:     64/    67 inuse bytes:    256K
      34 (  1296): inuse/total blocks:    138/   226 inuse/total pages:     68/    72 inuse bytes:    272K
      35 (  1424): inuse/total blocks:    140/   232 inuse/total pages:     78/    81 inuse bytes:    312K
      36 (  1552): inuse/total blocks:    157/   248 inuse/total pages:     89/    94 inuse bytes:    356K
      ...
```

SizeClassAllocator32 requires further refactoring to support this.

Reviewed By: cferris

Differential Revision: https://reviews.llvm.org/D158225




More information about the All-commits mailing list