rocksdb/port
Maysam Yabandeh 638d239507 Charge block cache for cache internal usage (#5797)
Summary:
For our default block cache, each additional entry has extra memory overhead. It include LRUHandle (72 bytes currently) and the cache key (two varint64, file id and offset). The usage is not negligible. For example for block_size=4k, the overhead accounts for an extra 2% memory usage for the cache. The patch charging the cache for the extra usage, reducing untracked memory usage outside block cache. The feature is enabled by default and can be disabled by passing kDontChargeCacheMetadata to the cache constructor.
This PR builds up on https://github.com/facebook/rocksdb/issues/4258
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5797

Test Plan:
- Existing tests are updated to either disable the feature when the test has too much dependency on the old way of accounting the usage or increasing the cache capacity to account for the additional charge of metadata.
- The Usage tests in cache_test.cc are augmented to test the cache usage under kFullChargeCacheMetadata.

Differential Revision: D17396833

Pulled By: maysamyabandeh

fbshipit-source-id: 7684ccb9f8a40ca595e4f5efcdb03623afea0c6f
2019-09-16 15:26:21 -07:00
..
win Use delete to disable automatic generated methods. (#5009) 2019-09-11 18:09:00 -07:00
jemalloc_helper.h Fix clang build with jemalloc (#5522) 2019-07-02 13:02:12 -07:00
likely.h Support pragma once in all header files and cleanup some warnings (#4339) 2018-09-05 18:13:31 -07:00
malloc.h Charge block cache for cache internal usage (#5797) 2019-09-16 15:26:21 -07:00
port_dirent.h #5145 , rename port/dirent.h to port/port_dirent.h to avoid compile err when use port dir as header dir output (#5152) 2019-04-04 11:38:19 -07:00
port_example.h Support pragma once in all header files and cleanup some warnings (#4339) 2018-09-05 18:13:31 -07:00
port_posix.cc fix sign compare warnings (#5651) 2019-07-30 14:12:54 -07:00
port_posix.h Revert changes from PR#5784 accidentally in PR#5780 (#5810) 2019-09-16 11:38:53 -07:00
port.h Change RocksDB License 2017-07-15 16:11:23 -07:00
README reverting disastrous MOE commit, returning to r21 2011-04-19 23:11:15 +00:00
stack_trace.cc Comment out unused variables 2018-03-05 13:13:41 -08:00
stack_trace.h Change RocksDB License 2017-07-15 16:11:23 -07:00
sys_time.h Support pragma once in all header files and cleanup some warnings (#4339) 2018-09-05 18:13:31 -07:00
util_logger.h Move some logging related files to logging/ (#5387) 2019-05-31 17:23:59 -07:00
xpress.h Change RocksDB License 2017-07-15 16:11:23 -07:00

This directory contains interfaces and implementations that isolate the
rest of the package from platform details.

Code in the rest of the package includes "port.h" from this directory.
"port.h" in turn includes a platform specific "port_<platform>.h" file
that provides the platform specific implementation.

See port_posix.h for an example of what must be provided in a platform
specific header file.