Skip to content

[LA64_DYNAREC] Speed up autocrc validation using exact match - #4139

Open
ksco wants to merge 1 commit into
ptitSeb:mainfrom
ksco:refactor-autocrc
Open

[LA64_DYNAREC] Speed up autocrc validation using exact match#4139
ksco wants to merge 1 commit into
ptitSeb:mainfrom
ksco:refactor-autocrc

Conversation

@ksco

@ksco ksco commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

This is about 3x faster than the scalar CRC approach with more memory consumption for always_test blocks. Given that always_test blocks should be rare, the trade-off is likely worthwhile.

This is about 3x faster than the scalar CRC approach with more memory consumption for always_test blocks. Given that always_test blocks should be rare, the trade-off is likely worthwhile.
@ptitSeb

ptitSeb commented Jul 28, 2026

Copy link
Copy Markdown
Owner

I have a hard time believing that comparing entire sources (so reading 2 blocks of the size) is faster than doing a crc (so reading only 1 block), no talking about the memory consumption.
Also, don't forget that on 16k pagsesize, many more page will have the NEVERCLEAN attribute.

@ksco

ksco commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

I noticed the bottleneck on a 16K page-size kernel running a benchmark. With this patch, that benchmark runs 3x faster. I also wrote a dedicated test to compare the 2 approach:

Scalar CRC: 1.0x
LSX: 4.03x faster
LASX: 7.72x faster

@ksco

ksco commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

Also, don't forget that on 16k pagsesize, many more page will have the NEVERCLEAN attribute.

I try to avoid introducing a new env var on this. Do you think it's necessary?

@ptitSeb

ptitSeb commented Jul 28, 2026

Copy link
Copy Markdown
Owner

I think it woul dbe better to come with an improved CRC algorythm instead. I really don't like the memory copy approach

@ksco

ksco commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

I'll think about this.

@ptitSeb

ptitSeb commented Jul 28, 2026

Copy link
Copy Markdown
Owner

I'll think about this.

Also, it would be worth just checking if the current autocrc works 100 fine and not generate false negative and force block to tbe rebuilt

@ksco

ksco commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

Nah, it's working as expected.

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.

2 participants