mariadb/storage/innobase/include
Marko Mäkelä a635c40648 MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit()
A prominent bottleneck in mtr_t::commit() is log_sys.mutex between
log_sys.append_prepare() and log_close().

User-visible change: The minimum innodb_log_file_size will be
increased from 1MiB to 4MiB so that some conditions can be
trivially satisfied.

log_sys.latch (log_latch): Replaces log_sys.mutex and
log_sys.flush_order_mutex. Copying mtr_t::m_log to
log_sys.buf is protected by a shared log_sys.latch.
Writes from log_sys.buf to the file system will be protected
by an exclusive log_sys.latch.

log_sys.lsn_lock: Protects the allocation of log buffer
in log_sys.append_prepare().

sspin_lock: A simple spin lock, for log_sys.lsn_lock.

Thanks to Vladislav Vaintroub for suggesting this idea, and for
reviewing these changes.

mariadb-backup: Replace some use of log_sys.mutex with recv_sys.mutex.

buf_pool_t::insert_into_flush_list(): Implement sorting of flush_list
because ordering is otherwise no longer guaranteed. Ordering by LSN
is needed for the proper operation of redo log checkpoints.

log_sys.append_prepare(): Advance log_sys.lsn and log_sys.buf_free by
the length, and return the old values. Also increment write_to_buf,
which was previously done in log_close().

mtr_t::finish_write(): Obtain the buffer pointer from
log_sys.append_prepare().

log_sys.buf_free: Make the field Atomic_relaxed,
to simplify log_flush_margin(). Use only loads and stores
to avoid costly read-modify-write atomic operations.

buf_pool.flush_list_requests: Replaces
export_vars.innodb_buffer_pool_write_requests
and srv_stats.buf_pool_write_requests.
Protected by buf_pool.flush_list_mutex.

buf_pool_t::insert_into_flush_list(): Do not invoke page_cleaner_wakeup().
Let the caller do that after a batch of calls.

recv_recover_page(): Invoke a minimal part of
buf_pool.insert_into_flush_list().

ReleaseBlocks::modified: A number of pages added to buf_pool.flush_list.

ReleaseBlocks::operator(): Merge buf_flush_note_modification() here.

log_t::set_capacity(): Renamed from log_set_capacity().
2022-02-10 16:37:12 +02:00
..
btr0btr.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
btr0btr.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
btr0bulk.h Merge 10.4 into 10.5 2021-04-14 11:35:39 +03:00
btr0cur.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
btr0cur.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
btr0defragment.h MDEV-25791: Remove UNIV_INTERN 2021-05-27 13:28:08 +03:00
btr0pcur.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
btr0pcur.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
btr0sea.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
btr0sea.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
btr0types.h
buf0block_hint.h MDEV-27058: Reduce the size of buf_block_t and buf_page_t 2021-11-18 17:47:19 +02:00
buf0buddy.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
buf0buf.h MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
buf0buf.inl Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
buf0checksum.h
buf0dblwr.h
buf0dump.h
buf0flu.h MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
buf0lru.h MDEV-26826 Duplicated computations of buf_pool.page_hash addresses 2021-10-22 12:33:37 +03:00
buf0rea.h Merge 10.6 into 10.7 2021-09-06 16:23:49 +03:00
buf0types.h Merge 10.6 into 10.7 2021-11-19 17:45:52 +02:00
data0data.h Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
data0data.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
data0type.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
data0type.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
data0types.h
db0err.h MDEV-25506 (3 of 3): Do not delete .ibd files before commit 2021-06-09 17:06:07 +03:00
dict0boot.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
dict0crea.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
dict0crea.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0defrag_bg.h MDEV-25919 fixup: Acquire MDL also in defragmentation 2021-09-18 14:39:32 +03:00
dict0dict.h Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
dict0dict.inl Merge branch '10.6' into 10.7 2022-02-04 14:11:46 +01:00
dict0load.h MDEV-24258 Merge dict_sys.mutex into dict_sys.latch 2021-08-31 13:51:35 +03:00
dict0mem.h Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
dict0mem.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
dict0pagecompress.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0pagecompress.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
dict0stats.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
dict0stats.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
dict0stats_bg.h MDEV-27094 Debug builds include useless InnoDB "disabled" options 2021-11-19 17:46:16 +02:00
dict0types.h MDEV-26966: Remove innodb_force_load_corrupted 2021-11-04 09:55:35 +02:00
dyn0buf.h
dyn0types.h
eval0eval.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
eval0eval.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
eval0proc.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
eval0proc.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
fil0crypt.h Merge branch '10.6' into 10.7 2022-02-04 14:11:46 +01:00
fil0crypt.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
fil0fil.h MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
fil0fil.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
fil0pagecompress.h Merge 10.6 into 10.7 2021-08-19 13:03:48 +03:00
fsp0file.h MDEV-14425 Improve the redo log for concurrency 2022-01-21 16:03:47 +02:00
fsp0fsp.h Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
fsp0space.h MDEV-26195: Use a 32-bit data type for some tablespace fields 2021-07-22 11:22:47 +03:00
fsp0sysspace.h MDEV-14425 Improve the redo log for concurrency 2022-01-21 16:03:47 +02:00
fsp0types.h MDEV-12933 sort out the compression library chaos 2021-10-27 15:55:14 +02:00
fts0ast.h
fts0blex.h
fts0fts.h Merge 10.5 into 10.6 2021-10-21 16:06:34 +03:00
fts0opt.h
fts0pars.h
fts0plugin.h
fts0priv.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
fts0priv.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
fts0tlex.h
fts0tokenize.h
fts0types.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
fts0types.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
fts0vlc.h MDEV-19522 InnoDB commit fails when FTS_DOC_ID value is greater than 4294967295 2021-10-21 12:56:59 +03:00
fut0fut.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
fut0lst.h Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
gis0geo.h
gis0rtree.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
gis0rtree.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
gis0type.h
ha0ha.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ha0ha.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ha0storage.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ha0storage.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ha_prototypes.h MDEV-23328 Server hang due to Galera lock conflict resolution 2021-10-29 20:40:35 +02:00
handler0alter.h
hash0hash.h MDEV-27025 insert-intention lock conflicts with waiting ORDINARY lock 2022-01-18 18:15:10 +03:00
ibuf0ibuf.h Merge branch '10.6' into 10.7 2022-02-04 14:11:46 +01:00
ibuf0ibuf.inl Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
ibuf0types.h
lock0iter.h
lock0lock.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
lock0lock.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
lock0prdt.h
lock0priv.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
lock0priv.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
lock0types.h
log0crypt.h MDEV-14425 Improve the redo log for concurrency 2022-01-21 16:03:47 +02:00
log0log.h MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
log0recv.h MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
log0types.h
mach0data.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
mach0data.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
mem0mem.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
mem0mem.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
mtr0log.h Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
mtr0mtr.h MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
mtr0mtr.inl MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
mtr0types.h MDEV-14425 Improve the redo log for concurrency 2022-01-21 16:03:47 +02:00
os0file.h Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
os0file.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
os0thread.h
page0cur.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
page0cur.inl Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
page0page.h Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
page0page.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
page0types.h MDEV-27058 fixup: GCC 11 -march=i686 -Warray-bounds 2021-12-04 12:55:26 +02:00
page0zip.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
page0zip.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
pars0grm.h Cleanup: Remove pars_stored_procedure_call() 2021-07-29 15:37:35 +03:00
pars0opt.h
pars0pars.h MDEV-25919 preparation: Various cleanup 2021-08-31 13:54:20 +03:00
pars0sym.h
pars0types.h
que0que.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
que0que.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
que0types.h
read0types.h
rem0cmp.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
rem0rec.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
rem0rec.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
rem0types.h
row0ext.h Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
row0ext.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
row0ftsort.h
row0import.h
row0ins.h
row0log.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
row0log.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
row0merge.h MDEV-26938 Support descending indexes internally in InnoDB 2022-01-26 18:43:05 +01:00
row0mysql.h Merge 10.5 into 10.6 2021-10-28 09:08:58 +03:00
row0purge.h MDEV-25919: Lock tables before acquiring dict_sys.latch 2021-08-31 13:54:44 +03:00
row0quiesce.h
row0row.h Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
row0row.inl Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
row0sel.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
row0sel.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
row0types.h
row0uins.h
row0umod.h
row0undo.h
row0upd.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
row0upd.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
row0vers.h
rw_lock.h MDEV-27667 Fix MDEV-26720 on 64-bit Microsoft Windows 2022-01-28 16:42:37 +02:00
srv0mon.h Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
srv0mon.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
srv0srv.h MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
srv0start.h
srw_lock.h MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
sux_lock.h MDEV-27058: Reduce the size of buf_block_t and buf_page_t 2021-11-18 17:47:19 +02:00
transactional_lock_guard.h Windows : fix clang-cl build. 2021-11-28 11:43:35 +01:00
trx0i_s.h Merge 10.2 into 10.3 2021-07-27 10:47:17 +03:00
trx0purge.h Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
trx0rec.h Merge branch '10.6' into 10.7 2022-02-04 14:11:46 +01:00
trx0rec.inl Merge branch '10.2' into 10.3 2022-01-29 15:41:05 +01:00
trx0roll.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
trx0rseg.h Merge branch '10.6' into 10.7 2022-02-04 14:11:46 +01:00
trx0rseg.inl Merge branch '10.6' into 10.7 2022-02-04 14:11:46 +01:00
trx0sys.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
trx0trx.h Merge branch '10.6' into 10.7 2022-02-04 14:11:46 +01:00
trx0trx.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
trx0types.h MDEV-26195: Use a 32-bit data type for some tablespace fields 2021-07-22 11:22:47 +03:00
trx0undo.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
trx0undo.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
trx0xa.h
univ.i MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit() 2022-02-10 16:37:12 +02:00
ut0byte.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ut0byte.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ut0counter.h MDEV-25281: Switch to use non-atomic (vs atomic) distributed counter to 2021-03-29 16:15:28 +03:00
ut0dbg.h
ut0list.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0list.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0lst.h
ut0mem.h Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ut0mem.inl Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
ut0new.h MDEV-26826 Duplicated computations of buf_pool.page_hash addresses 2021-10-22 12:33:37 +03:00
ut0pool.h MDEV-26882 InnoDB number of trx pools note improvement 2021-10-22 14:42:00 +03:00
ut0rbt.h
ut0rnd.h Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
ut0rnd.inl Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
ut0sort.h
ut0stage.h
ut0ut.h Merge branch '10.7' into 10.8 2022-02-04 14:50:25 +01:00
ut0ut.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0vec.h MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0vec.inl MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
ut0wqueue.h Merge 10.5 into 10.6 2021-10-21 16:06:34 +03:00