summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-11-11 15:09:23 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-11-11 15:13:23 +0200
commit0308de94ee806c21b6776ecab73396da75282596 (patch)
tree7accabdac71aa34675430ebc143736042249a406 /storage/innobase/include
parent3da895a736a15413d9873a16ea7ece0dd03ac0f7 (diff)
downloadmariadb-git-0308de94ee806c21b6776ecab73396da75282596.tar.gz
MDEV-17138 follow-up: Optimize fseg_create()
fseg_create(): Initialize FSEG_FRAG_ARRY by a single MLOG_MEMSET record. flst_zero_addr(), flst_init(): Optimize away redundant writes. fseg_free_page_low(): Write FIL_NULL by MLOG_MEMSET.
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/fut0lst.h8
-rw-r--r--storage/innobase/include/fut0lst.ic4
2 files changed, 9 insertions, 3 deletions
diff --git a/storage/innobase/include/fut0lst.h b/storage/innobase/include/fut0lst.h
index 3f68660ae89..9fa928eda23 100644
--- a/storage/innobase/include/fut0lst.h
+++ b/storage/innobase/include/fut0lst.h
@@ -85,8 +85,12 @@ inline void flst_init(buf_block_t* block, uint16_t ofs, mtr_t* mtr)
@param[in,out] mtr mini-transaction */
inline void flst_zero_addr(fil_faddr_t* faddr, mtr_t* mtr)
{
- mlog_memset(faddr + FIL_ADDR_PAGE, 4, 0xff, mtr);
- mlog_write_ulint(faddr + FIL_ADDR_BYTE, 0, MLOG_2BYTES, mtr);
+ if (mach_read_from_4(faddr + FIL_ADDR_PAGE) != FIL_NULL) {
+ mlog_memset(faddr + FIL_ADDR_PAGE, 4, 0xff, mtr);
+ }
+ if (mach_read_from_2(faddr + FIL_ADDR_BYTE)) {
+ mlog_write_ulint(faddr + FIL_ADDR_BYTE, 0, MLOG_2BYTES, mtr);
+ }
}
/********************************************************************//**
diff --git a/storage/innobase/include/fut0lst.ic b/storage/innobase/include/fut0lst.ic
index 0a4f2b24738..ec4181b2c93 100644
--- a/storage/innobase/include/fut0lst.ic
+++ b/storage/innobase/include/fut0lst.ic
@@ -82,7 +82,9 @@ flst_init(
MTR_MEMO_PAGE_X_FIX
| MTR_MEMO_PAGE_SX_FIX));
- mlog_write_ulint(base + FLST_LEN, 0, MLOG_4BYTES, mtr);
+ if (mach_read_from_4(base + FLST_LEN)) {
+ mlog_write_ulint(base + FLST_LEN, 0, MLOG_4BYTES, mtr);
+ }
flst_zero_addr(base + FLST_FIRST, mtr);
flst_zero_addr(base + FLST_LAST, mtr);
}