]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb: client: compress: LZ77 optimizations
authorEnzo Matsumiya <ematsumiya@suse.de>
Mon, 13 Apr 2026 19:07:10 +0000 (16:07 -0300)
committerSteve French <stfrench@microsoft.com>
Wed, 22 Apr 2026 14:55:43 +0000 (09:55 -0500)
commit4460e9c68d1a8d1bd5b892c01f10f2cd06b1fd8b
tree27ef086b235ef6b2233a735fe6e04b1c9d96cd5a
parentfca46b0e68c5d4f37c1dffb854ab125f702fa9e9
smb: client: compress: LZ77 optimizations

This patch implements several micro-optimizations on lz77_compress()
with the goal of reducing the number of instructions per [input]
byte (a.k.a. IPB).

Changes:
- change hashtable to be u32 (instead of u64) -- change the hash
  function to reflect that (adds lz77_hash() and lz77_read32() helpers)
- batch-write literals instead of 1 by 1 -- now that we have a well
  defined hot path (match finding) and a cold path (encode literals +
  match), batch writing makes a significant difference
- implement adaptive skipping of input bytes -- skip input bytes more
  aggressively if too few matches are being found
- name some constants for more meaningful context

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/compress/lz77.c
fs/smb/client/compress/lz77.h