Hi Enzo, On Fri, 22 Mar 2024 18:23:54 -0300, Enzo Matsumiya wrote: > Which brought me to the 'how to detect uncompressible data' subject; > practical test at hand: when writing this 289MiB ISO file to an SMB > share with compression enabled, only 7 out of 69 WRITE requests > (~10%) are compressed. > > (this is not the problem since SMB2 compression is supposed to be > done on a best-effort basis) > > So, best effort... for 90% of this particular ISO file, cifs.ko "compressed" > those requests, reached an output with size >= to input size, discarded it > all, and sent the original uncompressed request instead => lots of CPU > cycles wasted. Would be nice to not try to compress such data right of > the bat, or at least with minimal parsing, instead. Sounds like storing some compressible vs non-compressible write metrics alongside a compression-capable SMB2 FILEID would allow for a simple attempt-compression-on-next-write prediction mechanism. However, you'd be forced to re-learn compressibility with each reconnect or store it. FILE_ATTRIBUTE_COMPRESSED might also be available as a (user-provided) hint.