mtr_t::commit(): Remove the conditional update of log_sys.write_to_buf.
We do write to the log even if we are not marking pages modified for
the first time.
mtr_t::commit_shrink(): Let log_close() in mtr_t::finish_write() update
log_sys.write_to_buf.
On Linux, only enable O_DIRECT on the log for innodb_flush_method=O_DSYNC
A quick test with the log on a PCIe NVMe drive yields the best
throughput without O_DIRECT. With O_DIRECT|O_DSYNC
(enabled by innodb_flush_method=O_DSYNC) both the average and
the maximum throughput are a little faster.
The slowest would be O_DIRECT without O_DSYNC.
Hence, it probably is better to not use O_DIRECT on the log file
when not also setting O_DSYNC.
mtr_t::finish_write(): Avoid invoking
log_sys.set_check_flush_or_checkpoint() if log_sys.is_pmem().
The log_sys.max_buf_free has no meaning on the mmap-based log.
With this, the mmap-based log writes are finally faster than the
pwrite() and fdatasync() based writes.
Performance: Use pmem_persist() instead of pmem_deep_persist()
One PMEM device would deliver about 800 transaction commits per second
with pmem_deep_persist() and about 127,000 commits per second with
pmem_persist().
We will basically assume that the PMEM device does not lose writes
on power loss, just like the previous interface
pmem_memcpy_persist() did.
The calls do not seem to incur too much overhead after all.
Let us invoke pmem_deep_persist() also when running on /dev/shm
so that we can get more realistic estimates on actual PMEM performance.
log_t::create(): Also set flushed_to_disk_lsn, to avoid an
assertion failure in persist().