~percona-dev/percona-xtradb/fix-bug-405714

« back to all changes in this revision

Viewing changes to innodb_split_buf_pool_mutex.patch

  • Committer: Yasufumi Kinoshita
  • Date: 2009-07-31 09:50:43 UTC
  • Revision ID: kinoyasu@rynex6-20090731095043-ukdz20yhfs1hjovf
fix bug 405714

Show diffs side-by-side

added added

removed removed

Lines of Context:
2043
2043
 
2044
2044
                                old_page_count = page_count;
2045
2045
 
2046
 
@@ -1057,10 +1107,17 @@
2047
 
                                        space, offset, flush_type);
2048
 
                                } else {
2049
 
                                        /* Try to flush the page only */
2050
 
-                                       buf_pool_mutex_enter();
2051
 
+                                       //buf_pool_mutex_enter();
2052
 
+                                       rw_lock_s_lock(&page_hash_latch);
2053
 
 
2054
 
                                        mutex_t* block_mutex = buf_page_get_mutex(bpage);
2055
 
+retry_lock_2:
2056
 
                                        mutex_enter(block_mutex);
2057
 
+                                       if (block_mutex != buf_page_get_mutex(bpage)) {
2058
 
+                                               mutex_exit(block_mutex);
2059
 
+                                               block_mutex = buf_page_get_mutex(bpage);
2060
 
+                                               goto retry_lock_2;
2061
 
+                                       }
2062
 
 
2063
 
                                        buf_page_t* bpage_tmp = buf_page_hash_get(space, offset);
2064
 
                                        if (bpage_tmp) {
2065
2046
@@ -1073,7 +1130,10 @@
2066
2047
                                flush_type, offset,
2067
2048
                                page_count - old_page_count); */