summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2011-09-06 10:08:52 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2011-09-06 10:08:52 +0300
commit7f48c174f0b589f307c54f2bab28a465ffc92468 (patch)
tree3d46149c3f983ada6d65aaaf7510f4f9c39fcae4 /storage
parent2f49da3fdc4b4dc727794d346d0de1bc2f6d5244 (diff)
downloadmariadb-git-7f48c174f0b589f307c54f2bab28a465ffc92468.tar.gz
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
Diffstat (limited to 'storage')
-rw-r--r--storage/innodb_plugin/ChangeLog6
-rw-r--r--storage/innodb_plugin/buf/buf0buddy.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog
index 328cafff58f..a29aaf2077e 100644
--- a/storage/innodb_plugin/ChangeLog
+++ b/storage/innodb_plugin/ChangeLog
@@ -1,5 +1,11 @@
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:
Fix Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
diff --git a/storage/innodb_plugin/buf/buf0buddy.c b/storage/innodb_plugin/buf/buf0buddy.c
index de571743361..efc4fd46e90 100644
--- a/storage/innodb_plugin/buf/buf0buddy.c
+++ b/storage/innodb_plugin/buf/buf0buddy.c
@@ -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;