Skip to content

Commit e0718ed

Browse files
ardbiesheuvelEric Biggers
authored andcommitted
lib/crc: arm64: Drop unnecessary chunking logic from crc64
On arm64, kernel mode NEON executes with preemption enabled, so there is no need to chunk the input by hand. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20260330144630.33026-8-ardb@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent 5276ea1 commit e0718ed

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

lib/crc/arm64/crc64.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ static inline u64 crc64_nvme_arch(u64 crc, const u8 *p, size_t len)
1616
{
1717
if (len >= 128 && cpu_have_named_feature(PMULL) &&
1818
likely(may_use_simd())) {
19-
do {
20-
size_t chunk = min_t(size_t, len & ~15, SZ_4K);
19+
size_t chunk = len & ~15;
2120

22-
scoped_ksimd()
23-
crc = crc64_nvme_arm64_c(crc, p, chunk);
21+
scoped_ksimd()
22+
crc = crc64_nvme_arm64_c(crc, p, chunk);
2423

25-
p += chunk;
26-
len -= chunk;
27-
} while (len >= 128);
24+
p += chunk;
25+
len &= 15;
2826
}
2927
return crc64_nvme_generic(crc, p, len);
3028
}

0 commit comments

Comments
 (0)