uweseimet / scsi2pi

Advanced performant SCSI/SASI emulation and tools for the PiSCSI/RaSCSI board
https://www.scsi2pi.net
BSD 3-Clause "New" or "Revised" License
9 stars 2 forks source link

Add an optional non-caching image file access layer #57

Closed uweseimet closed 8 months ago

uweseimet commented 8 months ago

The existing image file cache is sector-oriented and uses memory-mapped files. Further it can only cope with cache items that have a size of a power to 2. (There are platform that use 520 bytes per sector.) This means that the cache also cannot support READ/WRITE LONG (also see #58). A memory-mapped file might not be the most efficient way of caching, but this has to be measured in practice. In order to evaluate/test the cache efficiency and to provide a basis for alternative (configurable) cache, a cache that does not do any caching at all shall be added as an experimental feature. Both the existing cache and the new "cache" shall use the same cache interface. A new per-device option "--caching-mode" shall be added to s2p. Valid values are "default" (backwards compatible with PiSCSI) and "off". "off" is only available for SCHD, SCRM, SCMD and SAHD.

With a Pi 4 the throughput without caching is about the same as with the default cache. With a Pi Zero W the throughput without caching is about 10% lower.