-
Notifications
You must be signed in to change notification settings - Fork 4
[upstream] extend the memory tier config to work with NUMA bindings and add tests #49
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 10 of 11 files at r1, all commit messages.
Reviewable status: 10 of 11 files reviewed, 3 unresolved discussions (waiting on @byrnedj and @vinser52)
cachelib/allocator/CacheAllocator-inl.h
line 116 at r1 (raw file):
XDCHECK_EQ(memoryTierConfigs.size(), 1ul); opts.memBindNumaNodes = memoryTierConfigs[0].getMemBind(); if (memoryTierConfigs.size() > 1) {
There is already assert 2 lines above so we'll never reach this line if we have 2 tiers. Perhaps it might be better to throw this exception from Config (congiureMemoryTiers) for now?
cachelib/allocator/CacheAllocator-inl.h
line 2184 at r1 (raw file):
template <typename CacheTrait> size_t CacheAllocator<CacheTrait>::getPoolSize(PoolId poolId) const {
Do you actually need this function? I think you could call getPoolStats and get the size from there.
cachelib/cachebench/util/CacheConfig.cpp
line 104 at r1 (raw file):
JSONSetVal(configJson, customConfigJson); JSONSetVal(configJson, usePosixShm);
why it's duplicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 10 of 11 files reviewed, 3 unresolved discussions (waiting on @byrnedj and @igchor)
cachelib/cachebench/util/CacheConfig.cpp
line 104 at r1 (raw file):
Previously, igchor (Igor Chorążewicz) wrote…
why it's duplicated?
Yeah, I think I already upstreamed these changes to Meta's main branch. Have you updated our main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format should be fixed
Reviewable status: 10 of 11 files reviewed, 3 unresolved discussions (waiting on @byrnedj and @vinser52)
dc3832d
to
461f9c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Reviewable status: 3 of 11 files reviewed, 3 unresolved discussions (waiting on @igchor and @vinser52)
cachelib/allocator/CacheAllocator-inl.h
line 116 at r1 (raw file):
Previously, igchor (Igor Chorążewicz) wrote…
There is already assert 2 lines above so we'll never reach this line if we have 2 tiers. Perhaps it might be better to throw this exception from Config (congiureMemoryTiers) for now?
configureMemoryTiers will throw if greater than kMaxTiers, so I removed this line.
cachelib/allocator/CacheAllocator-inl.h
line 2184 at r1 (raw file):
Previously, igchor (Igor Chorążewicz) wrote…
Do you actually need this function? I think you could call getPoolStats and get the size from there.
Done.
cachelib/cachebench/util/CacheConfig.cpp
line 104 at r1 (raw file):
Previously, vinser52 (Sergei Vinogradov) wrote…
Yeah, I think I already upstreamed these changes to Meta's main branch. Have you updated our main?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 11 files reviewed, 4 unresolved discussions (waiting on @byrnedj and @igchor)
cachelib/cachebench/util/CacheConfig.cpp
line 102 at r2 (raw file):
JSONSetVal(configJson, nvmAdmissionRetentionTimeThreshold); JSONSetVal(configJson, customConfigJson);
Why this line is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 11 files reviewed, 5 unresolved discussions (waiting on @byrnedj and @igchor)
cachelib/allocator/tests/AllocatorMemoryTiersTest.h
line 36 at r2 (raw file):
{MemoryTierCacheConfig::fromShm().setRatio(1).setMemBind( std::string("0")), MemoryTierCacheConfig::fromShm().setRatio(1).setMemBind(
Will this test fail today (because only a single tier is allowed)?
461f9c5
to
2bb164f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 11 files reviewed, 5 unresolved discussions (waiting on @igchor and @vinser52)
cachelib/allocator/tests/AllocatorMemoryTiersTest.h
line 36 at r2 (raw file):
Previously, vinser52 (Sergei Vinogradov) wrote…
Will this test fail today (because only a single tier is allowed)?
No because I increase kMaxTiers to 2 in CacheAllocatorConfig.h
cachelib/cachebench/util/CacheConfig.cpp
line 102 at r2 (raw file):
Previously, vinser52 (Sergei Vinogradov) wrote…
Why this line is removed?
I just noticed this when removing the duplicate - I fixed now. There should be no change to this file.
Code quote:
customConfigJson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3.
Reviewable status: 4 of 11 files reviewed, 4 unresolved discussions (waiting on @byrnedj and @igchor)
cachelib/allocator/tests/AllocatorMemoryTiersTest.h
line 36 at r2 (raw file):
Previously, byrnedj (Daniel Byrne) wrote…
No because I increase kMaxTiers to 2 in CacheAllocatorConfig.h
In that case, I think we should throw an exception in the CacheAllocator constructor if (number of tiers > 1) because CacheAllocator is not enabled yet to support more then 1 tier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 11 files reviewed, 4 unresolved discussions (waiting on @igchor and @vinser52)
cachelib/allocator/tests/AllocatorMemoryTiersTest.h
line 36 at r2 (raw file):
Previously, vinser52 (Sergei Vinogradov) wrote…
In that case, I think we should throw an exception in the CacheAllocator constructor if (number of tiers > 1) because CacheAllocator is not enabled yet to support more then 1 tier.
We currently have assert in CacheAllocator constructor to check number of tiers == 1, if you think exception is better I can change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 11 files reviewed, 4 unresolved discussions (waiting on @byrnedj and @igchor)
cachelib/allocator/tests/AllocatorMemoryTiersTest.h
line 36 at r2 (raw file):
Previously, byrnedj (Daniel Byrne) wrote…
We currently have assert in CacheAllocator constructor to check number of tiers == 1, if you think exception is better I can change.
Yeah, I think an exception is better because assert is usually used to check for an unexpected condition caused by a mistake in the code logic. In our case, config allows to set 2 tiers but CacheAllocator does not support it yet. In other words cache config is the external input and we cannot control it - it is better to throw an exception in that case.
2bb164f
to
a30859f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 11 files reviewed, 4 unresolved discussions (waiting on @igchor and @vinser52)
cachelib/allocator/tests/AllocatorMemoryTiersTest.h
line 36 at r2 (raw file):
Previously, vinser52 (Sergei Vinogradov) wrote…
Yeah, I think an exception is better because assert is usually used to check for an unexpected condition caused by a mistake in the code logic. In our case, config allows to set 2 tiers but CacheAllocator does not support it yet. In other words cache config is the external input and we cannot control it - it is better to throw an exception in that case.
okay - done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 11 files reviewed, 3 unresolved discussions (waiting on @igchor)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 11 files reviewed, 3 unresolved discussions (waiting on @igchor)
Summary: GitHub commits: facebook/wangle@43e5620 facebookexperimental/edencommon@3934bec facebookincubator/katran@a4c94aa Reviewed By: jurajh-fb fbshipit-source-id: 720310662068e4aa245198d817666700c9dde1d5
Summary: GitHub commits: facebook/fb303@c51a290 facebook/fbthrift@5e97023 facebook/proxygen@3710a32 facebook/wangle@fd29800 facebook/watchman@fca53d2 facebookexperimental/edencommon@3d8a6d9 facebookexperimental/rust-shed@75c5d75 facebookincubator/fizz@bae2d7e facebookincubator/katran@139c75d facebook/mvfst@001332d facebookincubator/velox@ec0ea1f Reviewed By: jurajh-fb fbshipit-source-id: a8a8ff6a7fddeaa7bbccb3faa6a737c50d22cfe2
Summary: As mentioned in the tasks, these stats make more sense in rates. Reviewed By: jiayuebao Differential Revision: D43243498 fbshipit-source-id: 556b0b4a062235bb3b34dd076e5f7a5a88316f8c
Summary: GitHub commits: facebook@ba9dd68 facebook/fbthrift@23208ff facebookincubator/velox@68b8a45 Reviewed By: jurajh-fb fbshipit-source-id: f8581e13cd1c0a2510d87f42c813ca2c65eaef1d
Summary: GitHub commits: facebook/fbthrift@3b00d58 Reviewed By: jurajh-fb fbshipit-source-id: 23ecb07e7e9ebd4dfbf3980de141ea1ebe36bb12
Summary: GitHub commits: facebook/fbthrift@df0eb61 facebook/proxygen@7fc3fea Reviewed By: jurajh-fb fbshipit-source-id: fa982baf35fd98edc52be391f03d15a9c2c333bf
Summary: GitHub commits: facebook/fbthrift@1d01d76 Reviewed By: jurajh-fb fbshipit-source-id: bdefba88e8d002c65d8b7c11e86c8aa772996d9b
Summary: GitHub commits: facebook/fbthrift@1b848d8 facebook/rocksdb@cfe50f7 pytorch/FBGEMM@c55d800 Reviewed By: bigfootjon fbshipit-source-id: e840d1116311ac52336e598442cf66cdc50d7725
Summary: GitHub commits: facebook/fbthrift@90fddab Reviewed By: bigfootjon fbshipit-source-id: cf7ac48c00c548805fb74663fe3e9bd9f5906cc2
Summary: Currently `replacedPtr` is passed as an argument and such usage isn't easy to understand (we kept receiving user feedback on that). Now we want to return it. Reviewed By: therealgymmy, antonf, jaesoo-fb Differential Revision: D43143989 fbshipit-source-id: eaae055107050cd67a7ca8b26b716fffc0c002f2
Summary: GitHub commits: facebook/fb303@5dada62 facebook/fbthrift@5782f94 facebook/litho@ef3b93e facebook/proxygen@9a63096 facebook/wangle@8e88e60 facebook/watchman@d2fb403 facebookexperimental/edencommon@e04a87f facebookexperimental/rust-shed@e638a99 facebookincubator/fizz@8d6e1c7 facebookincubator/katran@14c83d3 facebook/mvfst@4f24529 facebookincubator/velox@404237b Reviewed By: bigfootjon fbshipit-source-id: 25c61fba0e567a9dc87f6cc7dc5ba7bb0e0ccdaa
Summary: Previously, in order to use a file as the backing store of nvm cache, user needs to create the file with the given size a priori, hurting the usability of the feature. This change fixes it so that the new file with the given size is automatically created if not exist. Also, if the file exists with different size, this change will allow the cachebench to ftruncate or fallocate to the given size automatically. Reviewed By: therealgymmy Differential Revision: D44154281 fbshipit-source-id: c622102d4d67b64da83dcad4fdade66473d70a1f
Summary: GitHub commits: facebook@02ef4a1 facebook/fbthrift@721caa7 facebook/folly@60ffa0f facebook/litho@47e41c0 facebookincubator/Eigen-FBPlugins@742056b facebookincubator/velox@8b883b0 Reviewed By: bigfootjon fbshipit-source-id: 299df33a51a79533d3b9000f087731fa3a71323c
Summary: GitHub commits: facebook/fbthrift@9b313e2 Reviewed By: bigfootjon fbshipit-source-id: 4398acf93c32d22238246b0df0f01c2605483c97
Summary: GitHub commits: facebook/fbthrift@6fbae55 Reviewed By: bigfootjon fbshipit-source-id: 6f8278f6d8c2f25092b24aa41cee5f32c6e5ac3b
Summary: GitHub commits: facebook/fbthrift@6442718 facebookincubator/fizz@109be99 Reviewed By: bigfootjon fbshipit-source-id: 9c75f0e170a10e2b6cf1913b407f117f1f4091e5
Summary: GitHub commits: facebook/fbthrift@5763f96 Reviewed By: bigfootjon fbshipit-source-id: 56d3adc9df6b8e900d00622b5a7c08fe75d6c6a5
Reviewed By: DenisYaroshevskiy Differential Revision: D44396854 fbshipit-source-id: 17d3f4271f1bf8c403519471a54bd910af38814c
Summary: GitHub commits: facebook/fbthrift@48771f2 Reviewed By: bigfootjon fbshipit-source-id: 9c68f2e95e7b8007941238d42a6714682c5e4d68
Summary: GitHub commits: facebook/fbthrift@53fffa9 facebook/wangle@2ee1978 facebookexperimental/edencommon@deb8089 facebookincubator/fizz@71ea881 facebookincubator/katran@25da03a facebook/mvfst@bf7de7f facebookincubator/velox@651e597 Reviewed By: jailby fbshipit-source-id: f87121525892ad347dcf6d8d9d809828fc737de5
Summary: GitHub commits: facebook/fbthrift@7ab0a87 facebook/proxygen@22104db facebook/watchman@43ed48a facebookincubator/katran@926b507 facebookincubator/velox@3159ba9 Reviewed By: jailby fbshipit-source-id: 25e30991c7cb2da16ff3966627ff5a7fc182a553
Summary: When size-awareness is enabled for mutable workloads, user must call `objCache_->mutateObject(objPtr, mutationCb)` so that object-cache can track the updated size. What should happen inside `mutationCb`? 1. a construction of the new value with deep copy 2. if the new value is going to replace an old value, a destruction of the old value See unit test for examples. ----- Reviewed By: jaesoo-fb Differential Revision: D42872059 fbshipit-source-id: b94eddd6d640a04ee7974f9273509e60d5aa6915
Summary: GitHub commits: facebook/fbthrift@737cfa0 facebook/mvfst@24e04e1 facebookincubator/velox@55daa3e fairinternal/egohowto@f8b1870 Reviewed By: jailby fbshipit-source-id: e801db60548241573e35446c8676039a893752a9
Summary: GitHub commits: facebook/fbthrift@ef080b3 facebook/proxygen@a2d125b Reviewed By: jailby fbshipit-source-id: 1b820a1e3c85011c2b6f535caca237a74ec69568
Summary: GitHub commits: facebook/fbthrift@6b2d7a9 Reviewed By: jailby fbshipit-source-id: 3ccc40b3a1956cde45388e7e0ffad5d6196c517b
Summary: GitHub commits: facebook/fbthrift@639434b facebook/proxygen@a628b5a facebook/watchman@2fc3dba facebookincubator/velox@38d7601 Reviewed By: jailby fbshipit-source-id: 607d6696a1b803a79a4509c55de96e307f3b698a
Summary: GitHub commits: facebook/fbthrift@33a57fc Reviewed By: yns88 fbshipit-source-id: a8cc153a7b8c1491ae264b42e4d1aaf6d637aefe
Summary: GitHub commits: facebook/fb303@28cfb1d facebook/fbthrift@bb45e17 facebook/watchman@7aa562b facebookexperimental/rust-shed@47f504b facebookincubator/velox@58a8e26 Reviewed By: yns88 fbshipit-source-id: e56b09ecacd3bb3a4a8e7a16148faf44d5b0a437
Summary: GitHub commits: facebook/fbthrift@d0d2943 facebook/proxygen@ce6978b facebookincubator/velox@aed1ddf Reviewed By: yns88 fbshipit-source-id: 87cf81b096e7501d13a70ea6062da3e72a39aa65
Summary: GitHub commits: facebook/fbthrift@eb2041c facebook/proxygen@c23cd09 Reviewed By: yns88 fbshipit-source-id: df09b7f4c50e00d5a1491740c999b9008ccfed0e
Summary: GitHub commits: facebook/fbthrift@ea52832 facebook/proxygen@a080dfe facebook/wangle@a153b33 facebookincubator/katran@c24fd07 Reviewed By: yns88 fbshipit-source-id: 9e77bc08070edf5c78c85e856c57defc3b19f454
Summary: GitHub commits: facebook/fbthrift@cd36a53 facebook/watchman@b8c7a3d Reviewed By: yns88 fbshipit-source-id: a1ce2257a8630a9098f239ca49e294cf3dc6bce0
Summary: As title Reviewed By: jaesoo-fb Differential Revision: D44358110 fbshipit-source-id: d9359f25b9f6f58dd7f22cb0b45dd71b6a73848b
Summary: GitHub commits: facebook/fbthrift@59053eb Reviewed By: yns88 fbshipit-source-id: aea2de1893720da1b9b811c1fe00f3ad432fbfc5
Summary: GitHub commits: facebook@f24408d facebook/fb303@f94200e facebook/fbthrift@37243b4 facebook/watchman@c875359 facebookexperimental/rust-shed@2308da6 facebookresearch/vrs@b14c3ee Reviewed By: yns88 fbshipit-source-id: 9fc017f649e948fecee547f0afe1569a43dc03f1
Summary: This should be enabled by default It is an improvement in all cases. It’s roughly the same for hit-path. And, it helps miss path performance since it performs all the checks inline as opposed to thread-hop. Reviewed By: jaesoo-fb Differential Revision: D44554147 fbshipit-source-id: 6ec59d9ac1548ce30199ee1f3c495b92287fb739
Summary: GitHub commits: facebook/fb303@e3d5fe9 facebook/fbthrift@62c3335 facebookexperimental/rust-shed@cf98c92 facebookincubator/velox@0e5889c Reviewed By: yns88 fbshipit-source-id: a4281211b976f5c65929bbc3bd0305225ecabd38
a30859f
to
aab34a6
Compare
- Add in MemoryTier tests - Increase max number of tiers to 2 for tiers tests
This change is