Skip to content

Use Photon for ZFile and prefetch CRC32C checksums - #485

Open
williswus wants to merge 1 commit into
containerd:mainfrom
williswus:refactor/photon-crc32c
Open

williswus wants to merge 1 commit into
containerd:mainfrom
williswus:refactor/photon-crc32c

Conversation

@williswus

Copy link
Copy Markdown
Contributor

Use Photon CRC32C for ZFile and prefetch traces. Remove the local CRC32C implementation and the Intel DML and ISA-L dependencies.

Testing: 14 ZFile tests and 2 prefetch trace tests passed. Nine fixtures produced byte-identical files with the old and new implementations.

Signed-off-by: williswus <willis060510@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Missing software-backend and binary-trace checksum regression coverage leaves legacy CRC32C format and seed compatibility insufficiently verified.

2 open issues
What changed in this PR

Consolidates ZFile and persisted prefetch trace checksums on the existing Photon dependency, removing duplicated CRC32C code and optional Intel backends.

Changes:

  • Migrates checksum calls to Photon, with CPU-aware hardware/software selection for ZFile.
  • Removes the local CRC32C implementation and DML/ISA-L integration.
  • Adds legacy checksum vectors and updates build workflows, dependency tracking, and documentation.
File Description
src/​prefetch.cpp Uses Photon for chained trace checksums.
src/​overlaybd/​zfile/​zfile.cpp Adds guarded backend selection and migrates checksum calls.
src/​overlaybd/​zfile/​thirdparty/​CMakeLists.txt Removes Intel backend build steps.
src/​overlaybd/​zfile/​test/​test.cpp Adds legacy checksum vectors and updates checksum helpers.
src/​overlaybd/​zfile/​README.md Documents Photon checksum backend selection.
src/​overlaybd/​zfile/​crc32/​crc32c.h Removes the local checksum API.
src/​overlaybd/​zfile/​crc32/​crc32c.cpp Removes local checksum implementations and Intel acceleration.
src/​overlaybd/​zfile/​CMakeLists.txt Removes the CRC library target and links ZFile to Photon.
README.md Removes obsolete Intel options and submodule setup instructions.
README_zh.md Updates Chinese build instructions to match dependency removal.
.gitmodules Removes DML and ISA-L submodule declarations.
.github/​workflows/​tcmu-performance.yml Simplifies current builds while retaining baseline backend settings.
.github/​workflows/​release/​build.sh Removes unused Ubuntu packages and retired build flags.
.github/​workflows/​release.yml Stops checking out submodules.
.github/​workflows/​cmake.yml Removes Intel packages, flags, and submodule initialization.
.github/​dependabot.yml Removes submodule dependency updates.

Review effort: Max

Comment on lines +288 to 293
TEST_F(ZFileTest, legacy_crc32c) {
// Legacy metadata and data-block checksums for the same 512 bytes.
const char data[512] = "123456789";
EXPECT_EQ(0x3aed893fU, zfile_crc32c(data, sizeof(data)));
EXPECT_EQ(0x1de869e4U, crc32c_salt(data, sizeof(data)));
}
Comment thread src/prefetch.cpp

for (auto &each : m_record_array) {
hdr.checksum = crc32::crc32c_extend(&each, sizeof(TraceFormat), hdr.checksum);
hdr.checksum = crc32c_extend(&each, sizeof(TraceFormat), hdr.checksum);
// needs carry-less multiplication. Select the Photon backend once.
static const auto compute = [] {
#if defined(__x86_64__)
if (!__builtin_cpu_supports("pclmul"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

photon already checks for pclmul. Why check it again here?

@lihuiba

lihuiba commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

is there any performance degradation after switching implementation?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants