• Marko Mäkelä's avatar
    Bug#54914: InnoDB: performance drop with innodb_change_buffering=all · ef6f561a
    Marko Mäkelä authored
    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.
    ef6f561a
ibuf0ibuf.ic 10.2 KB