-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-34062: Implement innodb_log_file_mmap on 64-bit systems
When using the default innodb_log_buffer_size=2m, mariadb-backup --backup would spend a lot of time re-reading and re-parsing the log. For reads, it would be beneficial to memory-map the entire ib_logfile0 to the address space (typically 48 bits or 256 TiB) and read it from there, both during --backup and --prepare. That is what we will be doing by default. We can also enable memory-mapped log writes in case the new parameter innodb_log_file_mmap is set to ON. This could speed up I/O and allow the log data to be shared between mariadbd and mariadb-backup --backup in the RAM buffer. Memory-mapped regular files differ from log_sys.is_pmem() in the way that an open file handle to ib_logfile0 will be retained. That allows log_t::set_mmap() to enable or disable the interface with fewer operations. On Linux, on log checkpoint we will invoke fallocate() with FALLOC_FL_ZERO_RANGE and madvise() with MADV_DONTNEED in order to reduce the memory pressure. Without the fallocate() call, using MADV_DONTNEED could lead to reads of old garbage contents of the circular log file when a page fault occurs while writing a record. Most references to HAVE_PMEM or log_sys.is_pmem() are replaced with HAVE_INNODB_MMAP or log_sys.is_mmap(). The main difference is that PMEM skips the use of write_lock and flush_lock and uses pmem_persist(), while the memory-mapped interface will use a combination of msync() and fdatasync().
- Loading branch information
Showing
14 changed files
with
684 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.