Bug #12950803 62294: BUF_BUDDY_RELOCATE CALLS GETTIMEOFDAY ...

buf_buddy_relocate(): The ut_time_us() function is needed for
statistics, calculating the total time spent on relocating blocks.
Until now, we invoked ut_time_us() every time buf_buddy_relocate() was
called. Fix: Only call ut_time_us() when the block can be relocated.
After this fix, the reported relocated_usec will no longer include the
time for the page_hash lookup and for acquiring the block mutex.

Approved by Sunny Bains on IM
This commit is contained in:
Marko Mäkelä 2011-09-06 10:08:52 +03:00
parent 380e7babcc
commit 7088d13d83
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2011-09-06 The InnoDB Team
* buf/buf0buddy.c:
Fix Bug#12950803 62294: BUF_BUDDY_RELOCATE CALLS GETTIMEOFDAY
WHILE HOLDING BUFFER POOL MUTEX
2011-09-06 The InnoDB Team
* include/trx0undo.h, trx/trx0rec.c, trx/trx0undo.c:

View file

@ -327,7 +327,6 @@ buf_buddy_relocate(
{
buf_page_t* bpage;
const ulint size = BUF_BUDDY_LOW << i;
ullint usec = ut_time_us(NULL);
mutex_t* mutex;
ulint space;
ulint page_no;
@ -394,6 +393,7 @@ buf_buddy_relocate(
if (buf_page_can_relocate(bpage)) {
/* Relocate the compressed page. */
ullint usec = ut_time_us(NULL);
ut_a(bpage->zip.data == src);
memcpy(dst, src, size);
bpage->zip.data = dst;