rocksdb/cache
sdong c78a87cd71 Avoid malloc_usable_size() call inside LRU Cache mutex (#10026)
Summary:
In LRU Cache mutex, we sometimes call malloc_usable_size() to calculate memory used by the metadata object. We prevent it by saving the charge + metadata size, rather than charge, inside the metadata itself. Within the mutex, usually only total charge is needed so we don't need to repeat.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10026

Test Plan: Run existing tests.

Reviewed By: pdillinger

Differential Revision: D36556253

fbshipit-source-id: f60c96d13cde3af77732e5548e4eac4182fa9801
2022-05-24 13:31:16 -07:00
..
cache.cc Make SecondaryCache Customizable (#8480) 2021-07-06 09:18:08 -07:00
cache_bench.cc Add (& fix) some simple source code checks (#8821) 2021-09-07 21:19:27 -07:00
cache_bench_tool.cc Change type of cache buffer passed to `Cache::CreateCallback()` to `const void*` (#9595) 2022-02-17 21:09:56 -08:00
cache_entry_roles.cc Expose `CacheEntryRole` and map keys for block cache stat collections (#9838) 2022-04-14 09:38:55 -07:00
cache_entry_roles.h Expose `CacheEntryRole` and map keys for block cache stat collections (#9838) 2022-04-14 09:38:55 -07:00
cache_entry_stats.h New stable, fixed-length cache keys (#9126) 2021-12-16 17:15:13 -08:00
cache_helpers.h Use deleters to label cache entries and collect stats (#8297) 2021-05-19 16:51:13 -07:00
cache_key.cc Enhance new cache key testing & comments (#9329) 2022-02-04 14:15:58 -08:00
cache_key.h New stable, fixed-length cache keys (#9126) 2021-12-16 17:15:13 -08:00
cache_reservation_manager.cc Account memory of big memory users in BlockBasedTable in global memory limit (#9748) 2022-04-06 10:33:00 -07:00
cache_reservation_manager.h Account memory of big memory users in BlockBasedTable in global memory limit (#9748) 2022-04-06 10:33:00 -07:00
cache_reservation_manager_test.cc Meta-internal folly integration with F14FastMap (#9546) 2022-04-13 07:34:01 -07:00
cache_test.cc Remove own ToString() (#9955) 2022-05-06 13:03:58 -07:00
clock_cache.cc Update Cache::Release param from force_erase to erase_if_last_ref (#9728) 2022-03-22 10:22:18 -07:00
clock_cache.h
compressed_secondary_cache.cc Prevent double caching in the compressed secondary cache (#9747) 2022-04-11 13:28:33 -07:00
compressed_secondary_cache.h Prevent double caching in the compressed secondary cache (#9747) 2022-04-11 13:28:33 -07:00
compressed_secondary_cache_test.cc Prevent double caching in the compressed secondary cache (#9747) 2022-04-11 13:28:33 -07:00
fast_lru_cache.cc Avoid malloc_usable_size() call inside LRU Cache mutex (#10026) 2022-05-24 13:31:16 -07:00
fast_lru_cache.h Avoid malloc_usable_size() call inside LRU Cache mutex (#10026) 2022-05-24 13:31:16 -07:00
lru_cache.cc Avoid malloc_usable_size() call inside LRU Cache mutex (#10026) 2022-05-24 13:31:16 -07:00
lru_cache.h Avoid malloc_usable_size() call inside LRU Cache mutex (#10026) 2022-05-24 13:31:16 -07:00
lru_cache_test.cc Prevent double caching in the compressed secondary cache (#9747) 2022-04-11 13:28:33 -07:00
sharded_cache.cc Update Cache::Release param from force_erase to erase_if_last_ref (#9728) 2022-03-22 10:22:18 -07:00
sharded_cache.h Update Cache::Release param from force_erase to erase_if_last_ref (#9728) 2022-03-22 10:22:18 -07:00