Skip to content

ici/sdr: optimize syscalls for file backed sdr - #107

Open
zebastian wants to merge 2 commits into
nasa-jpl:integrationfrom
zebastian:sdr-file-opt
Open

ici/sdr: optimize syscalls for file backed sdr#107
zebastian wants to merge 2 commits into
nasa-jpl:integrationfrom
zebastian:sdr-file-opt

Conversation

@zebastian

Copy link
Copy Markdown
Contributor

This yields ~20-30 % more throughput for file backed sdr

Every file-backed access in the SDR dataspace and transaction log used a
separate lseek followed by read/write. The lseek syscall dominated the
file-backed path, since scattered field updates seek on every call, and
it left a window in which the file offset and the I/O could race.

Convert all of them to single positioned pread/pwrite calls:

- _sdrput dataspace write and _sdrfetch dataspace read (hot path)
- _sdrput reversible undo-capture read of the pre-image
- readFromLog log-entry read
- reverseTransaction dataspace restore writes (rollback path)

Reduction of syscalls yields better performance:
200k 64-byte writes, 16 per txn yield ~20-30% more throughput.
A reversible write logged its undo record in two steps -- a control
header (offset, length) then the affected bytes' pre-image -- which for
the persistent file log meant two write() syscalls per field updated.

Replace writeToLog with writevToLog, which appends the whole entry from
an iovec: for the file log a single positioned pwritev gathers the
header and pre-image directly from their existing locations (no
intermediate copy, one syscall instead of two).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant