Skip to content

Admission policies + some extra stats for cachebench #10

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 62 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 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
3181c63
tier admission
byrnedj Aug 25, 2022
f08e434
updated per review
byrnedj Sep 21, 2022
adcb0f7
added admission policy doc
byrnedj Sep 22, 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
24 changes: 24 additions & 0 deletions AdmissionPolicies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Admission Policies

## Allocation policies

- `maxAcAllocationWatermark`: Item is always allocated in topmost tier if at least this
percentage of the AllocationClass is free.
- `minAcAllocationWatermark`: Item is always allocated in bottom tier if only this percent
of the AllocationClass is free. If percentage of free AllocationClasses is between `maxAcAllocationWatermark`
and `minAcAllocationWatermark`: then extra checks (described below) are performed to decide where to put the element.

By default, allocation will always be performed from the upper tier.

- `acTopTierEvictionWatermark`: If there is less that this percent of free memory in topmost tier, cachelib will attempt to evict from top tier. This option takes precedence before allocationWatermarks.

### Extra policies (used only when percentage of free AllocationClasses is between `maxAcAllocationWatermark`
and `minAcAllocationWatermark`)
- `sizeThresholdPolicy`: If item is smaller than this value, always allocate it in upper tier.
- `defaultTierChancePercentage`: Change (0-100%) of allocating item in top tier

## MMContainer options

- `lruInsertionPointSpec`: Can be set per tier when LRU2Q is used. Determines where new items are
inserted. 0 = insert to hot queue, 1 = insert to warm queue, 2 = insert to cold queue
- `markUsefulChance`: Per-tier, determines chance of moving item to the head of LRU on access
2 changes: 2 additions & 0 deletions cachelib/allocator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ if (BUILD_TESTS)
add_test (tests/ChainedHashTest.cpp)
add_test (tests/AllocatorResizeTypeTest.cpp)
add_test (tests/AllocatorHitStatsTypeTest.cpp)
add_test (tests/AllocatorMemoryTiersTest.cpp)
add_test (tests/MemoryTiersTest.cpp)
add_test (tests/MultiAllocatorTest.cpp)
add_test (tests/NvmAdmissionPolicyTest.cpp)
add_test (tests/CacheAllocatorConfigTest.cpp)
Expand Down
9 changes: 8 additions & 1 deletion cachelib/allocator/Cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,30 @@ class CacheBase {
CacheBase(CacheBase&&) = default;
CacheBase& operator=(CacheBase&&) = default;

// TODO: come up with some reasonable number
static constexpr unsigned kMaxTiers = 2;

// Get a string referring to the cache name for this cache
virtual const std::string getCacheName() const = 0;

// Returns true for ObjectCacheBase, false for CacheAllocator.
virtual bool isObjectCache() const = 0;

// Get the reference to a memory pool, for stats purposes
// uses the top most memory tier by default
//
// @param poolId The pool id to query
virtual const MemoryPool& getPool(PoolId poolId) const = 0;

// Get Pool specific stats (regular pools). This includes stats from the
// Memory Pool and also the cache.
//
// @param poolId the pool id
virtual PoolStats getPoolStats(PoolId poolId) const = 0;

virtual AllocationClassBaseStat getAllocationClassStats(
TierId, PoolId pid, ClassId cid) const = 0;

// @param poolId the pool id
virtual AllSlabReleaseEvents getAllSlabReleaseEvents(PoolId poolId) const = 0;

Expand Down
Loading