Commit a9ea0056 authored by Eugene Kosov's avatar Eugene Kosov

MDEV-21133: use aligned memcpy in redo log and buffer pool

parent bbd2fa5c
......@@ -421,7 +421,8 @@ static bool buf_tmp_page_decrypt(byte* tmp_frame, byte* src_frame)
src_frame + srv_page_size - FIL_PAGE_FCRC32_CHECKSUM,
FIL_PAGE_FCRC32_CHECKSUM);
memcpy(src_frame, tmp_frame, srv_page_size);
memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(src_frame, tmp_frame,
srv_page_size);
srv_stats.pages_decrypted.inc();
srv_stats.n_temp_blocks_decrypted.inc();
......@@ -2125,7 +2126,8 @@ buf_page_realloc(
if (buf_page_can_relocate(&block->page)) {
mutex_enter(&new_block->mutex);
memcpy(new_block->frame, block->frame, srv_page_size);
memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(
new_block->frame, block->frame, srv_page_size);
new (&new_block->page) buf_page_t(block->page);
/* relocate LRU list */
......
......@@ -1085,7 +1085,8 @@ buf_dblwr_add_to_batch(
ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE);
UNIV_MEM_ASSERT_RW(frame, srv_page_size);
memcpy(p, frame, srv_page_size);
memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(p, frame,
srv_page_size);
}
buf_dblwr->buf_block_arr[buf_dblwr->first_free] = bpage;
......
......@@ -344,7 +344,8 @@ log_reserve_and_write_fast(
len += lsn_len;
} else
#endif /* UNIV_LOG_LSN_DEBUG */
memcpy(log_sys.buf + log_sys.buf_free, str, len);
memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(log_sys.buf + log_sys.buf_free,
str, len);
log_block_set_data_len(
reinterpret_cast<byte*>(ut_align_down(
......
......@@ -181,7 +181,8 @@ void log_buffer_extend(ulong len)
srv_log_buffer_size = new_buf_size;
log_sys.buf = new_buf;
log_sys.first_in_use = true;
memcpy(log_sys.buf, old_buf_begin, log_sys.buf_free);
memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(log_sys.buf, old_buf_begin,
log_sys.buf_free);
log_sys.max_buf_free = new_buf_size / LOG_BUF_FLUSH_RATIO
- LOG_BUF_FLUSH_MARGIN;
......@@ -354,7 +355,8 @@ log_write_low(
- log_sys.buf_free % OS_FILE_LOG_BLOCK_SIZE;
}
memcpy(log_sys.buf + log_sys.buf_free, str, len);
memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(log_sys.buf + log_sys.buf_free,
str, len);
str_len -= len;
str = str + len;
......@@ -833,8 +835,9 @@ log_buffer_switch()
}
/* Copy the last block to new buf */
memcpy(log_sys.buf, old_buf + area_end - OS_FILE_LOG_BLOCK_SIZE,
OS_FILE_LOG_BLOCK_SIZE);
memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(
log_sys.buf, old_buf + area_end - OS_FILE_LOG_BLOCK_SIZE,
OS_FILE_LOG_BLOCK_SIZE);
log_sys.buf_free %= OS_FILE_LOG_BLOCK_SIZE;
log_sys.buf_next_to_write = log_sys.buf_free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment