Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2512 commits
Select commit Hold shift + click to select a range
998d165
Updating submodules
Aug 23, 2022
1c56710
Updating submodules
Aug 23, 2022
7b8cba0
Updating submodules
Aug 23, 2022
899d344
Updating submodules
Aug 23, 2022
9cfbdaf
Updating submodules
Aug 23, 2022
219313f
Updating submodules
Aug 23, 2022
2eda5e4
Updating submodules
Aug 23, 2022
2081532
Edit Overview_A_random_walk_down_the_Cache_Library.md using inpage ed…
jaesoo-fb Aug 24, 2022
81ad50a
Updating submodules
Aug 24, 2022
16ed597
Updating submodules
Aug 24, 2022
95fd8a6
Throw exception when improperly passing TTL parameter in insert APIs
jiayuebao Aug 24, 2022
c5b8239
Updating submodules
Aug 25, 2022
012b35b
Updating submodules
Aug 25, 2022
e2e2e00
Updating submodules
Aug 25, 2022
8118866
Updating submodules
Aug 25, 2022
4fe7678
Updating submodules
Aug 25, 2022
160f46b
Updating submodules
Aug 25, 2022
36f109a
Updating submodules
Aug 25, 2022
5fae2ef
Updating submodules
Aug 25, 2022
267e79b
Updating submodules
Aug 25, 2022
d994bc1
Updating submodules
Aug 25, 2022
5486953
Updating submodules
Aug 25, 2022
664dbd1
Updating submodules
Aug 25, 2022
08054c8
Updating submodules
Aug 25, 2022
bce01e5
Updating submodules
Aug 25, 2022
ad5a8e7
Updating submodules
Aug 25, 2022
fea7fc6
Updating submodules
Aug 25, 2022
cabd034
Updating submodules
Aug 25, 2022
fa5fa64
Prevent divide by zero errors in ObjSize controller.
Aug 25, 2022
128f5f7
Updating submodules
Aug 25, 2022
ce60f7c
Updating submodules
Aug 25, 2022
c4f5b84
Updating submodules
Aug 26, 2022
ba3ccf5
Updating submodules
Aug 26, 2022
6415a20
Updating submodules
Aug 26, 2022
39acab4
Updating submodules
Aug 26, 2022
837502f
Updating submodules
Aug 26, 2022
6014a00
Updating submodules
Aug 26, 2022
f74386a
Updating submodules
Aug 26, 2022
7eb93a6
Updating submodules
Aug 26, 2022
95cfb64
Updating submodules
Aug 26, 2022
a6cf240
Updating submodules
Aug 26, 2022
f3c2380
Updating submodules
Aug 26, 2022
fc4efc5
Updating submodules
Aug 26, 2022
8c51e43
Updating submodules
Aug 26, 2022
67254c6
Updating submodules
Aug 26, 2022
32a2d22
Updating submodules
Aug 26, 2022
865baff
Updating submodules
Aug 26, 2022
3b76928
Updating submodules
Aug 26, 2022
9a61bd8
Updating submodules
Aug 26, 2022
abd6a8f
Mark navySizeClass in cachebench config as deprecated
Aug 26, 2022
3134095
Updating submodules
Aug 26, 2022
32b64ae
Multi object types support
jiayuebao Aug 26, 2022
ecb491c
Remove navySizeClasses from cachebench configs
Aug 26, 2022
fe4fd52
Updating submodules
Aug 26, 2022
65976d6
Updating submodules
Aug 26, 2022
c5c0bf5
Updating submodules
Aug 26, 2022
8e801c4
Updating submodules
Aug 26, 2022
4ebae69
Updating submodules
Aug 27, 2022
4d2211e
Updating submodules
Aug 27, 2022
5c76313
Updating submodules
Aug 27, 2022
01db7ab
Updating submodules
Aug 27, 2022
3d089ca
Updating submodules
Aug 27, 2022
ea1d53d
Updating submodules
Aug 27, 2022
c9c9735
Updating submodules
Aug 28, 2022
769e4b3
Updating submodules
Aug 28, 2022
58291de
Updating submodules
Aug 29, 2022
4d2a6f3
Updating submodules
Aug 29, 2022
674df12
Updating submodules
Aug 29, 2022
3b28016
Updating submodules
Aug 29, 2022
056e7e2
Updating submodules
Aug 29, 2022
94af054
Clean up headers from CacheAllocator-inl.h
therealgymmy Aug 29, 2022
08a7aa7
Add eviction attempts stats
therealgymmy Aug 29, 2022
cb839e6
Updating submodules
Aug 29, 2022
e0806de
Updating submodules
Aug 29, 2022
4ae0e9a
Updating submodules
Aug 29, 2022
c07b9ff
Updating submodules
Aug 29, 2022
f3eb660
Updating submodules
Aug 29, 2022
33913d7
Updating submodules
Aug 29, 2022
58fe717
Updating submodules
Aug 30, 2022
8f903bc
Updating submodules
Aug 30, 2022
0b21342
Updating submodules
Aug 30, 2022
3da455b
Updating submodules
Aug 30, 2022
838badd
Updating submodules
Aug 30, 2022
f11b126
Updating submodules
Aug 30, 2022
a9478c1
Updating submodules
Aug 30, 2022
896f95c
Updating submodules
Aug 30, 2022
568d4f7
Updating submodules
Aug 30, 2022
da1eb56
Updating submodules
Aug 30, 2022
232fe8b
Daily `arc lint --take CLANGFORMAT`
Aug 30, 2022
dccfd21
Updating submodules
Aug 30, 2022
f0bbac2
Updating submodules
Aug 30, 2022
6b6e6d0
Updating submodules
Aug 30, 2022
854d5a1
Updating submodules
Aug 30, 2022
f50ec60
Updating submodules
Aug 30, 2022
726d22a
Updating submodules
Aug 30, 2022
c33e1ca
Updating submodules
Aug 30, 2022
6d2462d
Updating submodules
Aug 30, 2022
4a0ed24
Updating submodules
Aug 30, 2022
4db3252
Updating submodules
Aug 30, 2022
37ef75a
Updating submodules
Aug 30, 2022
5d46d8e
Updating submodules
Aug 30, 2022
c2b9a54
Updating submodules
Aug 30, 2022
8ec8b68
Updating submodules
Aug 30, 2022
c2fee8c
Updating submodules
Aug 30, 2022
46a2226
Updating submodules
Aug 30, 2022
0b01289
Updating submodules
Aug 30, 2022
bb5fb02
Updating submodules
Aug 30, 2022
0d16857
Updating submodules
Aug 31, 2022
5c73b3a
Updating submodules
Aug 31, 2022
419b69a
Updating submodules
Aug 31, 2022
7e352b3
Updating submodules
Aug 31, 2022
8b795ff
Updating submodules
Aug 31, 2022
cddafac
Updating submodules
Aug 31, 2022
4b02fce
fix flaky test AllocatorResizeTest/ShrinkWithFreeMem
jaesoo-fb Aug 31, 2022
9d92d93
Updating submodules
Aug 31, 2022
05ab8ef
Updating submodules
Aug 31, 2022
a47786a
Updating submodules
Aug 31, 2022
2be8d2e
Updating submodules
Aug 31, 2022
a24e17f
Updating submodules
Aug 31, 2022
bafbfad
Updating submodules
Aug 31, 2022
1f0a6f3
Updating submodules
Sep 1, 2022
cec7cda
Updating submodules
Sep 1, 2022
e9fea65
Updating submodules
Sep 1, 2022
e0073c3
Updating submodules
Sep 1, 2022
0bd9e26
Remove create<T>() API
jiayuebao Sep 1, 2022
d8fd790
Updating submodules
Sep 1, 2022
46ec2f2
Updating submodules
Sep 1, 2022
90659cd
Updating submodules
Sep 1, 2022
6d0a2fa
Updating submodules
Sep 1, 2022
05dea80
Updating submodules
Sep 1, 2022
a831036
Updating submodules
Sep 1, 2022
9e8173e
Updating submodules
Sep 1, 2022
d25199f
Updating submodules
Sep 1, 2022
bce408d
Updating submodules
Sep 1, 2022
3149b88
Updating submodules
Sep 1, 2022
a764807
Updating submodules
Sep 1, 2022
a2c3531
Updating submodules
Sep 1, 2022
9cfd7f1
Removed unused getEvictableMMContainer function from CacheAllocator
Sep 1, 2022
9a4d86b
Updating submodules
Sep 2, 2022
8602816
Updating submodules
Sep 2, 2022
cf1e069
Updating submodules
Sep 2, 2022
ad45d9b
Updating submodules
Sep 2, 2022
01fd45d
Updating submodules
Sep 2, 2022
8566895
Updating submodules
Sep 2, 2022
198a27a
Updating submodules
Sep 2, 2022
7f8f1c0
Updating submodules
Sep 2, 2022
487d7ee
Updating submodules
Sep 2, 2022
02bedd5
Updating submodules
Sep 2, 2022
025391f
Updating submodules
Sep 2, 2022
bb07e26
Updating submodules
Sep 2, 2022
a167408
Updating submodules
Sep 2, 2022
2ad847d
Updating submodules
Sep 3, 2022
e286e42
Updating submodules
Sep 5, 2022
7677031
Updating submodules
Sep 5, 2022
b0f800d
Updating submodules
Sep 5, 2022
69eec43
Updating submodules
Sep 5, 2022
4c9865b
Updating submodules
Sep 5, 2022
6c03c57
Updating submodules
Sep 5, 2022
c06c5ff
Updating submodules
Sep 5, 2022
2120545
Updating submodules
Sep 5, 2022
1368d4f
Updating submodules
Sep 6, 2022
347e67b
Updating submodules
Sep 6, 2022
3fa0db2
Updating submodules
Sep 6, 2022
fa75106
Updating submodules
Sep 6, 2022
691149d
Updating submodules
Sep 6, 2022
d875006
Updating submodules
Sep 6, 2022
4cbf3f1
Return empty stats if allocation class is not initialized
Sep 6, 2022
ba837f0
Simple typo fix in itemDestructor example
jiayuebao Sep 6, 2022
ecffd96
Updating submodules
Sep 6, 2022
4d35cf4
Updating submodules
Sep 7, 2022
4761625
Updating submodules
Sep 7, 2022
e50462a
Updating submodules
Sep 7, 2022
104ada7
Updating submodules
Sep 7, 2022
6b54954
Updating submodules
Sep 7, 2022
ab01043
Updating submodules
Sep 7, 2022
4ccdf64
Run centos and debian workflows on push and PR
igchor Nov 2, 2021
fad6c0e
Introduce FileShmSegment for file-backed shared memory
igchor Oct 20, 2021
039df09
Adjust and enable tests for ShmFileSegment
igchor Oct 16, 2021
5adcb88
Add support for shm opts serialization
guptask Oct 27, 2021
497c694
Initial version of config API extension to support multiple memory tiers
victoria-mcgrath Oct 28, 2021
be64d5e
Integrate Memory Tier config API with CacheAllocator.
igchor Oct 30, 2021
db07a94
Add MemoryTierCacheConfig::fromShm()
igchor Nov 6, 2021
9aa5176
Fix test_shm_manager.cpp test
igchor Nov 9, 2021
abfaf7f
Run tests on CI
igchor Nov 5, 2021
2f2e78c
Run long tests (navy/bench) every day on CI
igchor Nov 16, 2021
3cd7fb2
Moved common segment code for posix and file shm segments into ShmCommon
guptask Nov 7, 2021
6358b37
Enabled memory tier config API for cachebench.
victoria-mcgrath Nov 18, 2021
4f2a562
Enabled shared memory tier in cachebench.
victoria-mcgrath Nov 23, 2021
8e97fc6
Run CI on prebuild docker image
igchor Dec 15, 2021
7cfafa3
Run only centos build on CI
igchor Dec 15, 2021
8d26dcb
Initial multi-tier support implementation
igchor Sep 28, 2021
dd93753
Extend CompressedPtr to work with multiple tiers
igchor Dec 11, 2021
0b39a94
Implemented async Item movement between tiers
vinser52 Dec 18, 2021
2606770
Adding example for multitiered cache
vinser52 Dec 9, 2021
6091f16
Enable workarounds in tests
igchor Dec 24, 2021
69cf5ff
Add basic multi-tier test
igchor Dec 30, 2021
efab02b
Set correct size for each memory tier
igchor Dec 30, 2021
9fa830c
Aadding new configs to hit_ratio/graph_cache_leader_fobj
vinser52 Jan 27, 2022
f513b06
Fix eviction flow and removeCb calls
vinser52 Feb 3, 2022
f11cc6c
Remove failing build-cachelib workflow (#42)
igchor Feb 7, 2022
786552b
Disabled test suite allocator-test-AllocatorTypeTest (#41)
victoria-mcgrath Feb 7, 2022
c57827e
Do not compensate for rounding error when calculating tier sizes (#43)
igchor Feb 8, 2022
bbf072b
Fixed total cache size in CacheMemoryStats (#38)
victoria-mcgrath Feb 8, 2022
50d37fb
Update docker file used in CI
igchor Feb 14, 2022
7d99409
Disable failing clang-format-check
igchor Feb 14, 2022
2040a51
Add one more navy test to BLACKLIST
igchor Feb 15, 2022
eb30d92
Fix issue with "Destorying an unresolved handle"
vinser52 Feb 17, 2022
730f3e0
Add extra param to build-package.sh
igchor Apr 8, 2022
468fb9d
Add scripts for rebuilding/pushing docker images
igchor Apr 8, 2022
ca92a34
Extend CI to rebuild docker automatically
igchor Apr 8, 2022
abad204
Update build-cachelib-docker.yml
igchor Apr 27, 2022
37d7b38
Added required packages to install Intel ittapi
mcengija Apr 26, 2022
c8dce0c
Fix slab release code
igchor Jun 10, 2022
e59b1fe
Shorten critical section in findEviction
igchor Apr 12, 2022
41f8425
critical section inside combined_lock
igchor Jun 13, 2022
5b4ec2a
Enable touchValue by default
igchor Jun 15, 2022
0a7ed05
Issue75 rebased (#88)
igchor Jul 5, 2022
cd2b3ad
Add memory usage statistics for slabs and allocation classes
igchor Jul 6, 2022
8478fda
Add option to print memory stats in bytes only
igchor Jul 12, 2022
43ad67f
added per tier pool class rolling average latency
guptask Jul 21, 2022
4a6307f
MM2Q promotion iterators (#1)
byrnedj Aug 9, 2022
b61397e
use transparent sync for item movement
byrnedj Aug 25, 2022
6122ab9
remove extra whitespace
byrnedj Aug 25, 2022
1c18489
Fix deprecation warning in multitier example
vinser52 Sep 1, 2022
19473e9
Implement NUMA binding support for SysVShmSegment
vinser52 Aug 25, 2022
d23774a
Implement NUMA binding support for PosixShmSegment
vinser52 Sep 1, 2022
d4ff258
Adding AllocatorMemoryTiersTest for NUMA bindings
vinser52 Aug 31, 2022
b0e2574
Extend cachebench to bind memory tiers to NUMA nodes
vinser52 Aug 29, 2022
f0c5c54
Merge pull request #15 from vinser52/fix_deprecation_warn
vinser52 Sep 13, 2022
f1dfc60
Update CI to use intel/CacheLib repo (#17)
vinser52 Sep 13, 2022
63c9029
Clean-up test's blacklist (#18)
vinser52 Sep 13, 2022
a4c4ab3
Merge pull request #13 from vinser52/numa_binding
vinser52 Sep 13, 2022
c5f7404
initial bg movers
byrnedj Aug 17, 2022
a474465
simple tests
byrnedj Sep 19, 2022
db0aaa4
format code + rework documentation
byrnedj Sep 21, 2022
d8c58ff
more restrictive test
byrnedj Sep 21, 2022
8d4f1a9
actually enable background workers + improved test
byrnedj Sep 22, 2022
8de0a1c
fixed memory tiers code block in config
byrnedj Oct 4, 2022
f07f668
stop workers
byrnedj Oct 5, 2022
7eef396
fixed test
byrnedj Oct 5, 2022
b31c5ad
a better test
byrnedj Oct 5, 2022
1efa046
remove extra headers
byrnedj Oct 6, 2022
dc7f5de
revert fbthrift dep
byrnedj Oct 6, 2022
f40e8c0
fix fizz
byrnedj Oct 6, 2022
72bfe1f
fix folly
byrnedj Oct 6, 2022
d16e606
fix wangle
byrnedj Oct 6, 2022
2b11a12
rolling latency added
danielobiri Oct 19, 2022
d23cdc9
rolling average added
danielobiri Oct 20, 2022
317ffdd
Delete bdm directory
danielobiri Oct 20, 2022
8699dd7
Update config-4GB-DRAM-4GB-PMEM-default_new_test4.json
danielobiri Oct 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: build-cachelib-centos-latest
on:
schedule:
- cron: '30 5 * * 1,4'
- cron: '0 7 * * *'

jobs:
build-cachelib-centos8-latest:
name: "CentOS/latest - Build CacheLib with all dependencies"
Expand Down Expand Up @@ -33,3 +34,6 @@ jobs:
uses: actions/checkout@v2
- name: "build CacheLib using build script"
run: ./contrib/build.sh -j -v -T
- name: "run tests"
timeout-minutes: 60
run: cd opt/cachelib/tests && ../../../run_tests.sh long
6 changes: 5 additions & 1 deletion .github/workflows/build-cachelib-debian.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: build-cachelib-debian-10
on:
schedule:
- cron: '30 5 * * 2,6'
- cron: '30 5 * * 0,3'

jobs:
build-cachelib-debian-10:
name: "Debian/Buster - Build CacheLib with all dependencies"
Expand Down Expand Up @@ -37,3 +38,6 @@ jobs:
uses: actions/checkout@v2
- name: "build CacheLib using build script"
run: ./contrib/build.sh -j -v -T
- name: "run tests"
timeout-minutes: 60
run: cd opt/cachelib/tests && ../../../run_tests.sh
49 changes: 49 additions & 0 deletions .github/workflows/build-cachelib-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: build-cachelib-docker
on:
push:
pull_request:

jobs:
build-cachelib-docker:
name: "CentOS/latest - Build CacheLib with all dependencies"
runs-on: ubuntu-latest
env:
REPO: cachelib
GITHUB_REPO: intel/CacheLib
CONTAINER_REG: ghcr.io/pmem/cachelib
CONTAINER_REG_USER: ${{ secrets.GH_CR_USER }}
CONTAINER_REG_PASS: ${{ secrets.GH_CR_PAT }}
FORCE_IMAGE_ACTION: ${{ secrets.FORCE_IMAGE_ACTION }}
HOST_WORKDIR: ${{ github.workspace }}
WORKDIR: docker
IMG_VER: devel
strategy:
matrix:
CONFIG: ["OS=centos OS_VER=8streams PUSH_IMAGE=1"]
steps:
- name: "System Information"
run: |
echo === uname ===
uname -a
echo === /etc/os-release ===
cat /etc/os-release
echo === df -hl ===
df -hl
echo === free -h ===
free -h
echo === top ===
top -b -n1 -1 -Eg || timeout 1 top -b -n1
echo === env ===
env
echo === gcc -v ===
gcc -v
- name: "checkout sources"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Pull the image or rebuild and push it
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh $FORCE_IMAGE_ACTION

- name: Run the build
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh
147 changes: 0 additions & 147 deletions .github/workflows/build-cachelib.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# From: https://github.com/marketplace/actions/clang-format-check#multiple-paths
name: clang-format Check
on: [pull_request]
on: []
jobs:
formatting-check:
name: Formatting Check
Expand All @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v3.4.0
uses: jidicula/clang-format-action@v4.6.2
with:
clang-format-version: '11'
clang-format-version: '13'
check-path: ${{ matrix.path }}
25 changes: 25 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration

specfile_path: cachelib.spec

upstream_package_name: CacheLib
downstream_package_name: cachelib

actions:
fix-spec-file:
- bash -c "sed -i cachelib.spec -e \"s/%global commit.*/%global commit $(git rev-parse HEAD)/\""
- bash -c "sed -i cachelib.spec -e \"s/%global date.*/%global date $(git show -s --date=format:'%Y%m%d' --format=%cd)/\""
create-archive:
- bash -c "COMMIT=$(git rev-parse HEAD); curl -ORL https://github.com/facebook/CacheLib/archive/${COMMIT}/cachelib-${COMMIT}.tar.gz; echo cachelib-${COMMIT}.tar.gz"
post-upstream-clone: "bash -c \"rm -rf cachelib-dist-git; git clone -b packit https://pagure.io/meta/cachelib.git cachelib-dist-git && mv cachelib-dist-git/cachelib*.{spec,patch} .\""

jobs:
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-rawhide-aarch64
- fedora-rawhide-x86_64
- fedora-35-aarch64
- fedora-35-x86_64
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## V17
In this version, `CacheAllocator::ItemHandle` is removed. Updating to this version will cause compilation error if `ItemHandle` is still used.

## V16

This version is incompatible with versions below 15. Downgrading from this version directly to a version below 15 will require the cache to be dropped. If you need to downgrade from this version, please make sure you downgrade to version 15 first to avoid dropping the cache.
Expand All @@ -8,7 +11,7 @@ This version is incompatible with versions below 15. Downgrading from this versi

This version is incompatible with any previous versions.

Updating to this version may cause compliation error because:
Updating to this version may cause compilation error because:
- The following APIs are removed:
1. CacheAllocator::allocatePermanent_deprecated.

Expand Down
95 changes: 95 additions & 0 deletions MultiTierDataMovement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Background Data Movement

In order to reduce the number of online evictions and support asynchronous
promotion - we have added two periodic workers to handle eviction and promotion.

The diagram below shows a simplified version of how the background evictor
thread (green) is integrated to the CacheLib architecture.

<p align="center">
<img width="640" height="360" alt="BackgroundEvictor" src="cachelib-background-evictor.png">
</p>

## Synchronous Eviction and Promotion

- `disableEviction`: Disables eviction to memory (item is always evicted to NVMe or removed
on eviction)

## Background Evictors

The background evictors scan each class to see if there are objects to move the next (lower)
tier using a given strategy. Here we document the parameters for the different
strategies and general parameters.

- `backgroundEvictorIntervalMilSec`: The interval that this thread runs for - by default
the background evictor threads will wake up every 10 ms to scan the AllocationClasses. Also,
the background evictor thread will be woken up everytime there is a failed allocation (from
a request handling thread) and the current percentage of free memory for the
AllocationClass is lower than `lowEvictionAcWatermark`. This may render the interval parameter
not as important when there are many allocations occuring from request handling threads.

- `evictorThreads`: The number of background evictors to run - each thread is a assigned
a set of AllocationClasses to scan and evict objects from. Currently, each thread gets
an equal number of classes to scan - but as object size distribution may be unequal - future
versions will attempt to balance the classes among threads. The range is 1 to number of AllocationClasses.
The default is 1.

- `maxEvictionBatch`: The number of objects to remove in a given eviction call. The
default is 40. Lower range is 10 and the upper range is 1000. Too low and we might not
remove objects at a reasonable rate, too high and it might increase contention with user threads.

- `minEvictionBatch`: Minimum number of items to evict at any time (if there are any
candidates)

- `maxEvictionPromotionHotness`: Maximum candidates to consider for eviction. This is similar to `maxEvictionBatch`
but it specifies how many candidates will be taken into consideration, not the actual number of items to evict.
This option can be used to configure duration of critical section on LRU lock.


### FreeThresholdStrategy (default)

- `lowEvictionAcWatermark`: Triggers background eviction thread to run
when this percentage of the AllocationClass is free.
The default is `2.0`, to avoid wasting capacity we don't set this above `10.0`.

- `highEvictionAcWatermark`: Stop the evictions from an AllocationClass when this
percentage of the AllocationClass is free. The default is `5.0`, to avoid wasting capacity we
don't set this above `10`.


## Background Promoters

The background promoters scan each class to see if there are objects to move to a lower
tier using a given strategy. Here we document the parameters for the different
strategies and general parameters.

- `backgroundPromoterIntervalMilSec`: The interval that this thread runs for - by default
the background promoter threads will wake up every 10 ms to scan the AllocationClasses for
objects to promote.

- `promoterThreads`: The number of background promoters to run - each thread is a assigned
a set of AllocationClasses to scan and promote objects from. Currently, each thread gets
an equal number of classes to scan - but as object size distribution may be unequal - future
versions will attempt to balance the classes among threads. The range is `1` to number of AllocationClasses. The default is `1`.

- `maxProtmotionBatch`: The number of objects to promote in a given promotion call. The
default is 40. Lower range is 10 and the upper range is 1000. Too low and we might not
remove objects at a reasonable rate, too high and it might increase contention with user threads.

- `minPromotionBatch`: Minimum number of items to promote at any time (if there are any
candidates)

- `numDuplicateElements`: This allows us to promote items that have existing handles (read-only) since
we won't need to modify the data when a user is done with the data. Therefore, for a short time
the data could reside in both tiers until it is evicted from its current tier. The default is to
not allow this (0). Setting the value to 100 will enable duplicate elements in tiers.

### Background Promotion Strategy (only one currently)

- `promotionAcWatermark`: Promote items if there is at least this
percent of free AllocationClasses. Promotion thread will attempt to move `maxPromotionBatch` number of objects
to that tier. The objects are chosen from the head of the LRU. The default is `4.0`.
This value should correlate with `lowEvictionAcWatermark`, `highEvictionAcWatermark`, `minAcAllocationWatermark`, `maxAcAllocationWatermark`.
- `maxPromotionBatch`: The number of objects to promote in batch during BG promotion. Analogous to
`maxEvictionBatch`. It's value should be lower to decrease contention on hot items.

2 changes: 1 addition & 1 deletion cachelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.

cmake_minimum_required (VERSION 3.19)
cmake_minimum_required (VERSION 3.12)

## TODO: get version from variable
project (CacheLib VERSION 0.1)
Expand Down
Loading