diff options
author | Marko Mäkelä <marko.makela@oracle.com> | 2010-08-10 13:22:48 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@oracle.com> | 2010-08-10 13:22:48 +0300 |
commit | 271e6ae34117db9475da877beb5ec2a0c7495872 (patch) | |
tree | 8169a7e668160badd28493f250e732ed06ede72b /storage/innobase/include/ibuf0ibuf.ic | |
parent | a4c5cf7ca9efcf386600c5da5f049dcab9e86046 (diff) | |
download | mariadb-git-271e6ae34117db9475da877beb5ec2a0c7495872.tar.gz |
Bug#54914: InnoDB: performance drop with innodb_change_buffering=all
Reduce ibuf_mutex and ibuf_pessimistic_insert_mutex contention further.
Protect ibuf->empty by the insert buffer root page latch, not ibuf_mutex.
ibuf_tree_root_get(): Assert that ibuf_mutex is owned by the
caller. Assert that the stamped page number is correct. Assert that
ibuf->empty agrees with the root page.
ibuf_size_update(): Do not update ibuf->empty.
ibuf_init_at_db_start(): Update ibuf->empty while holding the root page latch.
ibuf_add_free_page(): Return TRUE/FALSE instead of DB_SUCCESS/DB_STRONG_FAIL.
ibuf_remove_free_page(): Release ibuf_pessimistic_insert_mutex as
early as possible.
ibuf_contract_ext(): Rely on a dirty read of ibuf->empty, unless the
server is being shut down. Never acquire ibuf_mutex. Eliminate n_stored.
ibuf_contract_after_insert(): Never acquire ibuf_mutex. Perform dirty
reads of ibuf->size and ibuf->max_size.
ibuf_insert_low(): Only acquire ibuf_mutex for mode==BTR_MODIFY_TREE.
Perform dirty reads of ibuf->size and ibuf->max_size. Update
ibuf->empty while holding the root page latch.
ibuf_delete_rec(): Update ibuf->empty while holding the root page latch.
ibuf_is_empty(): Release ibuf_mutex earlier.
Diffstat (limited to 'storage/innobase/include/ibuf0ibuf.ic')
-rw-r--r-- | storage/innobase/include/ibuf0ibuf.ic | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic index aee27cf9739..e3fa6e3e929 100644 --- a/storage/innobase/include/ibuf0ibuf.ic +++ b/storage/innobase/include/ibuf0ibuf.ic @@ -46,11 +46,12 @@ struct ibuf_struct{ ulint seg_size; /*!< allocated pages of the file segment containing ibuf header and tree */ - ibool empty; /*!< after an insert to the ibuf tree - is performed, this is set to FALSE, - and if a contract operation finds - the tree empty, this is set to - TRUE */ + ibool empty; /*!< Protected by the page + latch of the root page of the + insert buffer tree + (FSP_IBUF_TREE_ROOT_PAGE_NO). TRUE + if and only if the insert + buffer tree is empty. */ ulint free_list_len; /*!< length of the free list */ ulint height; /*!< tree height */ dict_index_t* index; /*!< insert buffer index */ |