leil-io / saunafs

SaunaFS is a free-and open source, distributed POSIX file system inspired by Google File System.
https://saunafs.com
GNU General Public License v3.0
62 stars 5 forks source link

feat(chunkserver): Use aligned memory for writes #225

Closed lgsilva3087 closed 1 month ago

lgsilva3087 commented 1 month ago

The memory for write operations is now aligned to 4 KiB, which allows to later implement disks writes in DirectIO. It also benefits SMR writes by removing the need of memcpy to align the buffer with the underlying drive block size.

The previous approach was also resizing constantly the vector PacketStruct::packet, which implies frequent allocations. The new PacketStruct::alignedBuffer is now reused most of the time without constant allocations.