Skip to content

New dynamic #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 86 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
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
187bbf4
Fix ReaperSkippingSlabTraversalWhileSlabReleasing test
vinser52 Sep 15, 2022
829a434
Merge pull request #19 from vinser52/fix_allocator_test
vinser52 Sep 19, 2022
1762b57
Fix moveRegularItemWithSync and add tests
vinser52 Oct 7, 2022
1a9525b
Merge pull request #27 from vinser52/fix_async_movement
vinser52 Oct 11, 2022
4f8a592
Background data movement (#20)
byrnedj Oct 21, 2022
32b9a36
New Dynamic Eviction
danielobiri Oct 26, 2022
ceb6833
New Dynamic Eviction
danielobiri Oct 26, 2022
47e447d
Delete build-zstd directory
danielobiri Oct 26, 2022
3607bcc
Rename config-4GB-DRAM-4GB-PMEM-default_new_test4.json to config-new_…
danielobiri Oct 26, 2022
033e09e
Delete cachelib/external directory
danielobiri Oct 26, 2022
dee761c
Update CacheConfig.cpp
danielobiri Oct 26, 2022
5c19faa
external added
danielobiri Oct 26, 2022
c8b3a1c
Delete cachelib/external directory
danielobiri Oct 26, 2022
5da310f
Revert "Delete cachelib/external directory"
danielobiri Oct 26, 2022
849062d
Revert "Revert "Delete cachelib/external directory""
danielobiri Oct 26, 2022
27ec479
Revert "Delete cachelib/external directory"
danielobiri Oct 26, 2022
08ad14e
Merge branch 'new_dynamic' of https://github.com/danielobiri/CacheLib…
danielobiri Oct 26, 2022
2c89b2a
Revert "Delete cachelib/external directory"
danielobiri Oct 26, 2022
337d25f
Revert "Revert "Delete cachelib/external directory""
danielobiri Oct 26, 2022
48bcec2
Revert "Revert "Revert "Delete cachelib/external directory"""
danielobiri Oct 26, 2022
61c8c58
Update DynamicFreeThresholdStrategy.h
danielobiri Oct 31, 2022
a767b37
Update DynamicFreeThresholdStrategy.cpp
danielobiri Nov 1, 2022
af17dda
Update DynamicFreeThresholdStrategy.h
danielobiri Nov 1, 2022
6960422
cosmetic changes made after code review
guptask Nov 1, 2022
c8cfdd3
fix merge conflict
guptask Nov 1, 2022
e470b8b
Merge pull request #1 from guptask/dynamic_eviction_config_fix
danielobiri Nov 1, 2022
011d0d4
Update DynamicFreeThresholdStrategy.cpp
danielobiri Nov 8, 2022
b20d3d5
Update DynamicFreeThresholdStrategy.cpp
danielobiri Nov 9, 2022
41b1b4c
Update DynamicFreeThresholdStrategy.cpp
danielobiri Nov 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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.

2 changes: 1 addition & 1 deletion .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 Down
90 changes: 90 additions & 0 deletions MultiTierDataMovement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# 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>

## 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.

Loading