Skip to content

Commit 454f95b

Browse files
committed
navy: default checksum offload gate 16 KiB
Submitting and polling a DSA descriptor costs a few microseconds whatever the size, about what the CPU needs to CRC 16-32 KiB. Measured on cachebench's cdn hit-ratio workload (values p50 13 KB / p90 78 KB, 3 reps, user CPU vs software CRC): 4 KiB gate -17.6%, 16 KiB -21.5%, 32 KiB -23.0% (within rep noise of 16 KiB), 64 KiB -19.3%. Values under ~16 KiB cost more to offload than to checksum. Raise the default from 4096 to 16384 in BlockCache::Config, NavyConfig, cachebench and the harness; a config that sets the gate explicitly is unchanged.
1 parent 68c36fd commit 454f95b

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎cachelib/allocator/nvmcache/NavyConfig.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,10 @@ class BlockCacheConfig {
540540
// to Intel DSA via the DTO library. Requires data checksum to be enabled
541541
// and CacheLib built with BUILD_WITH_DTO. @minSize is the minimum value
542542
// size to use the offloaded path; smaller values are checksummed in
543-
// software to avoid accelerator submission overhead.
543+
// software, since submitting and polling a descriptor costs about what the
544+
// CPU needs to CRC 16-32 KiB (16 KiB measured as the break-even).
544545
BlockCacheConfig& setChecksumOffload(bool checksumOffload,
545-
uint32_t minSize = 4096) noexcept {
546+
uint32_t minSize = 16384) noexcept {
546547
checksumOffload_ = checksumOffload;
547548
checksumOffloadMinSize_ = minSize;
548549
return *this;
@@ -716,7 +717,7 @@ class BlockCacheConfig {
716717
// Whether to offload data checksumming to Intel DSA (fused with the value
717718
// copy on the write path), and the minimum value size to do so.
718719
bool checksumOffload_{false};
719-
uint32_t checksumOffloadMinSize_{4096};
720+
uint32_t checksumOffloadMinSize_{16384};
720721
uint32_t checksumOffloadReadMinSize_{0};
721722
bool checksumOffloadCacheControl_{true};
722723
// Whether to remove an item by checking the key (true) or only the hash value

‎cachelib/cachebench/util/CacheConfig.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ struct CacheConfig : public JSONConfig {
280280
// (no intermediate copy), or do that copy on Intel DSA.
281281
bool navyBlockCacheDirectFlush{false};
282282
bool navyBlockCacheFlushCopyOffload{false};
283-
uint32_t navyChecksumOffloadMinSize{4096};
283+
uint32_t navyChecksumOffloadMinSize{16384};
284284
// separate gate for read-side verification (0 = same as the write gate;
285285
// 4294967295 disables read-side offload), and the cache-control hint on the
286286
// fused write copy. See BlockCache::Config.

‎cachelib/navy/block_cache/BlockCache.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ class BlockCache final : public Engine {
6161
// checksum to be enabled. No effect when built without DTO support.
6262
bool checksumOffload{false};
6363
// Minimum value size to use the offloaded (fused) path on the WRITE path;
64-
// smaller values use software copy+checksum to avoid accelerator
65-
// submission overhead.
66-
uint32_t checksumOffloadMinSize{4096};
64+
// smaller values use software copy+checksum. Submitting and polling a
65+
// descriptor costs a few microseconds regardless of size, about what the
66+
// CPU needs to CRC 16-32 KiB; on a size-diverse (CDN) workload a 16 KiB
67+
// gate beat 4 KiB by 4% of process CPU and 32 KiB was indistinguishable.
68+
uint32_t checksumOffloadMinSize{16384};
6769
// Minimum value size to offload checksum VERIFICATION (lookup, reclaim,
6870
// reinsertion, cleanup). 0 = same as checksumOffloadMinSize. The read side
6971
// has no CPU work to overlap with the accelerator, so its break-even size

‎run_dsa_cachebench.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ if isTraceReplay:
186186
cc["navyDataChecksum"] = True
187187
cc["navyChecksumOffload"] = offload == "on"
188188
# only a default: a base config that sets the gate (a size sweep) wins
189-
cc.setdefault("navyChecksumOffloadMinSize", 4096)
189+
cc.setdefault("navyChecksumOffloadMinSize", 16384)
190190
elif offload != "none":
191191
# Synthetic workloads (CDN): the base config is DRAM-only; add the
192192
# hybrid Navy tier the offload applies to.
@@ -199,7 +199,7 @@ elif offload != "none":
199199
cc.setdefault("navyWriterThreads", 32)
200200
cc["navyDataChecksum"] = True
201201
cc["navyChecksumOffload"] = offload == "on"
202-
cc.setdefault("navyChecksumOffloadMinSize", 4096)
202+
cc.setdefault("navyChecksumOffloadMinSize", 16384)
203203
204204
huge = int(os.environ.get("HUGE_BYTES", "0"))
205205
# DRAM cache (slabs + hash table) on SysV shm so the page-size knob actually

0 commit comments

Comments
 (0)