Skip to content

Investigate trylock in tcache_dalloc #807

Open

Description

@interwq

The first attempt to use trylock in tcache_dalloc (part of #800) resulted in a significant CPU & memory regression under a production workload. However, stats showed that # of bytes cached in tcache hardly increased, and were far from the amount of rss regressed. @jasone pointed out that purging looked less effective, e.g. extents purged were smaller. This indicates the regression is likely caused by fragmentation, or even false sharing if it's a remote arena.

A few things to try:

  1. if it's a remote arena, don't use trylock;
  2. maybe in flush logic, find out items from remote arena, and flush them first;
  3. upon trylock failure, instead of move on to the next item, move all items from this arena to the bottom of the bin.
  4. instead of trylock once, do a spin loop (per arena);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions