Skip to content

crimson/osd/lsan_suppressions.cc: Add MallocExtension::Initialize() - #51875

Merged
athanatos merged 3 commits into
ceph:mainfrom
Matan-B:wip-matanb-crimson-supress-tcmalloc
Jun 6, 2023
Merged

athanatos merged 3 commits into
ceph:mainfrom
Matan-B:wip-matanb-crimson-supress-tcmalloc

Conversation

@Matan-B

@Matan-B Matan-B commented Jun 1, 2023 •

Copy link
Copy Markdown
Contributor

#46062 is cherry-picked here only to verify that make-check passes. Drafted until then.

In similarity to lsan.supp:

# from perfglue/heap_profiler.cc
# gperftools allocates a singleton and never frees it
leak:^MallocExtension::Register

Shouls suppress this:

==2692420==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 45 byte(s) in 1 object(s) allocated from:
    #0 0x5641d4ffaedd in operator new(unsigned long) (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/unittest-object-data-handler+0x7c01edd) (BuildId: 7aeb00a388469f4de54fedaaceb47fc006ce2906)
..
    #7 0x7fb22a6426f0 in MallocExtension::Initialize() (/lib/x86_64-linux-gnu/libtcmalloc.so.4+0x2a6f0) (BuildId: eeef3d1257388a806e122398dbce3157ee568ef4)

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

In similarity to lsan.supp:
```
leak:^MallocExtension::Register
```

Shouls suppress this:
```
==2692420==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 45 byte(s) in 1 object(s) allocated from:
    #0 0x5641d4ffaedd in operator new(unsigned long) (/home/jenkins-build/build/workspace/ceph-pull-requests/build/bin/unittest-object-data-handler+0x7c01edd) (BuildId: 7aeb00a388469f4de54fedaaceb47fc006ce2906)
..
    ceph#7 0x7fb22a6426f0 in MallocExtension::Initialize() (/lib/x86_64-linux-gnu/libtcmalloc.so.4+0x2a6f0) (BuildId: eeef3d1257388a806e122398dbce3157ee568ef4)
```

Signed-off-by: Matan Breizman <[email protected]>
@Matan-B
Matan-B force-pushed the wip-matanb-crimson-supress-tcmalloc branch from d0531ec to 970465c Compare June 5, 2023 10:07
@github-actions github-actions Bot added the tests label Jun 5, 2023
Matan-B and others added 2 commits June 5, 2023 11:58
…seastar

classic-osds have always caused significant memory fragmentation
when using the libc memory allocator due to the way that Ceph
tends to utilize memory.  In recent testing, crimson-osd was found
to use 25-27GB of RAM with the stock 3GB bluestore cache settings
(osd_memory_target is only used when tcmalloc is available).  Upon
further testing, it was found that the classic OSD is even worse,
using between 32-33GB of RAM after a 5 minute 4K sequential
write test when using libc malloc.

The good news is that it appears that crimson-osd is able to use
tcmalloc for alienstore without significant modification. Better
still, it drastically reduces memory usage.  In the same test that
resulted in 25GB RSS memory usage for crimson-osd with libc malloc,
a tcmalloc linked version took around 9GB (with an 8GB
osd_memory_target).  Since we do not yet (afaik) expose classic OSD
debugging in crimson it is tough to tell why we are still a little
over, but it's clear that for alienstore we are going to need to
use tcmalloc as we do in classic.

Signed-off-by: Mark Nelson <[email protected]>
(cherry picked from commit 9f31ad7b7388996307808e26722260aed29d4ea1)
@Matan-B
Matan-B force-pushed the wip-matanb-crimson-supress-tcmalloc branch from 970465c to 380bc6d Compare June 5, 2023 12:04
@Matan-B
Matan-B marked this pull request as ready for review June 5, 2023 12:36
@Matan-B
Matan-B requested a review from a team as a code owner June 5, 2023 12:36
@Matan-B

Matan-B commented Jun 5, 2023

Copy link
Copy Markdown
Contributor Author

make check looks ok, I will omit 380bc6d after approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants