Lines 8-23
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
8 |
+ mutex_create(&(buf_pool->flush_list_mutex)); |
8 |
+ mutex_create(&(buf_pool->flush_list_mutex)); |
9 |
+ mutex_create(&(buf_pool->LRU_mutex)); |
9 |
+ mutex_create(&(buf_pool->LRU_mutex)); |
10 |
+ mutex_create(&(buf_pool->free_mutex)); |
10 |
+ mutex_create(&(buf_pool->free_mutex)); |
11 |
+ mutex_create(&(buf_pool->hash_mutex)); |
11 |
+ rw_lock_create(&(buf_pool->hash_latch)); |
12 |
+ mutex_set_level(&(buf_pool->flush_list_mutex), SYNC_NO_ORDER_CHECK); |
12 |
+ mutex_set_level(&(buf_pool->flush_list_mutex), SYNC_NO_ORDER_CHECK); |
13 |
+ mutex_set_level(&(buf_pool->LRU_mutex), SYNC_NO_ORDER_CHECK); |
13 |
+ mutex_set_level(&(buf_pool->LRU_mutex), SYNC_NO_ORDER_CHECK); |
14 |
+ mutex_set_level(&(buf_pool->free_mutex), SYNC_NO_ORDER_CHECK); |
14 |
+ mutex_set_level(&(buf_pool->free_mutex), SYNC_NO_ORDER_CHECK); |
15 |
+ mutex_set_level(&(buf_pool->hash_mutex), SYNC_NO_ORDER_CHECK); |
15 |
+ rw_lock_set_level(&(buf_pool->hash_latch), SYNC_NO_ORDER_CHECK); |
16 |
+ |
16 |
+ |
17 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
17 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
18 |
+ mutex_enter(&(buf_pool->flush_list_mutex)); |
18 |
+ mutex_enter(&(buf_pool->flush_list_mutex)); |
19 |
+ mutex_enter(&(buf_pool->free_mutex)); |
19 |
+ mutex_enter(&(buf_pool->free_mutex)); |
20 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
20 |
+ rw_lock_x_lock(&(buf_pool->hash_latch)); |
21 |
mutex_enter(&(buf_pool->mutex)); |
21 |
mutex_enter(&(buf_pool->mutex)); |
22 |
|
22 |
|
23 |
if (srv_use_awe) { |
23 |
if (srv_use_awe) { |
Lines 28-34
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
28 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
28 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
29 |
+ mutex_exit(&(buf_pool->flush_list_mutex)); |
29 |
+ mutex_exit(&(buf_pool->flush_list_mutex)); |
30 |
+ mutex_exit(&(buf_pool->free_mutex)); |
30 |
+ mutex_exit(&(buf_pool->free_mutex)); |
31 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
31 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
32 |
mutex_exit(&(buf_pool->mutex)); |
32 |
mutex_exit(&(buf_pool->mutex)); |
33 |
|
33 |
|
34 |
if (srv_use_adaptive_hash_indexes) { |
34 |
if (srv_use_adaptive_hash_indexes) { |
Lines 88-99
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
88 |
buf_block_t* block; |
88 |
buf_block_t* block; |
89 |
|
89 |
|
90 |
- mutex_enter_fast(&(buf_pool->mutex)); |
90 |
- mutex_enter_fast(&(buf_pool->mutex)); |
91 |
+ mutex_enter_fast(&(buf_pool->hash_mutex)); |
91 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
92 |
|
92 |
|
93 |
block = buf_page_hash_get(space, offset); |
93 |
block = buf_page_hash_get(space, offset); |
94 |
|
94 |
|
95 |
- mutex_exit(&(buf_pool->mutex)); |
95 |
- mutex_exit(&(buf_pool->mutex)); |
96 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
96 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
97 |
|
97 |
|
98 |
return(block); |
98 |
return(block); |
99 |
} |
99 |
} |
Lines 102-108
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
102 |
buf_block_t* block; |
102 |
buf_block_t* block; |
103 |
|
103 |
|
104 |
- mutex_enter_fast(&(buf_pool->mutex)); |
104 |
- mutex_enter_fast(&(buf_pool->mutex)); |
105 |
+ mutex_enter_fast(&(buf_pool->hash_mutex)); |
105 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
106 |
|
106 |
|
107 |
block = buf_page_hash_get(space, offset); |
107 |
block = buf_page_hash_get(space, offset); |
108 |
|
108 |
|
Lines 111-117
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
111 |
} |
111 |
} |
112 |
|
112 |
|
113 |
- mutex_exit(&(buf_pool->mutex)); |
113 |
- mutex_exit(&(buf_pool->mutex)); |
114 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
114 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
115 |
} |
115 |
} |
116 |
|
116 |
|
117 |
/************************************************************************ |
117 |
/************************************************************************ |
Lines 120-126
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
120 |
ibool is_hashed; |
120 |
ibool is_hashed; |
121 |
|
121 |
|
122 |
- mutex_enter_fast(&(buf_pool->mutex)); |
122 |
- mutex_enter_fast(&(buf_pool->mutex)); |
123 |
+ mutex_enter_fast(&(buf_pool->hash_mutex)); |
123 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
124 |
|
124 |
|
125 |
block = buf_page_hash_get(space, offset); |
125 |
block = buf_page_hash_get(space, offset); |
126 |
|
126 |
|
Lines 129-135
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
129 |
} |
129 |
} |
130 |
|
130 |
|
131 |
- mutex_exit(&(buf_pool->mutex)); |
131 |
- mutex_exit(&(buf_pool->mutex)); |
132 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
132 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
133 |
|
133 |
|
134 |
return(is_hashed); |
134 |
return(is_hashed); |
135 |
} |
135 |
} |
Lines 138-144
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
138 |
buf_block_t* block; |
138 |
buf_block_t* block; |
139 |
|
139 |
|
140 |
- mutex_enter_fast(&(buf_pool->mutex)); |
140 |
- mutex_enter_fast(&(buf_pool->mutex)); |
141 |
+ mutex_enter_fast(&(buf_pool->hash_mutex)); |
141 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
142 |
|
142 |
|
143 |
block = buf_page_hash_get(space, offset); |
143 |
block = buf_page_hash_get(space, offset); |
144 |
|
144 |
|
Lines 147-153
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
147 |
} |
147 |
} |
148 |
|
148 |
|
149 |
- mutex_exit(&(buf_pool->mutex)); |
149 |
- mutex_exit(&(buf_pool->mutex)); |
150 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
150 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
151 |
|
151 |
|
152 |
return(block); |
152 |
return(block); |
153 |
} |
153 |
} |
Lines 156-162
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
156 |
buf_block_t* block; |
156 |
buf_block_t* block; |
157 |
|
157 |
|
158 |
- mutex_enter_fast(&(buf_pool->mutex)); |
158 |
- mutex_enter_fast(&(buf_pool->mutex)); |
159 |
+ mutex_enter_fast(&(buf_pool->hash_mutex)); |
159 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
160 |
|
160 |
|
161 |
block = buf_page_hash_get(space, offset); |
161 |
block = buf_page_hash_get(space, offset); |
162 |
|
162 |
|
Lines 165-171
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
165 |
} |
165 |
} |
166 |
|
166 |
|
167 |
- mutex_exit(&(buf_pool->mutex)); |
167 |
- mutex_exit(&(buf_pool->mutex)); |
168 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
168 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
169 |
|
169 |
|
170 |
return(block); |
170 |
return(block); |
171 |
} |
171 |
} |
Lines 189-200
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
189 |
} |
189 |
} |
190 |
|
190 |
|
191 |
if (block == NULL) { |
191 |
if (block == NULL) { |
192 |
+ mutex_enter_fast(&(buf_pool->hash_mutex)); |
192 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
193 |
block = buf_page_hash_get(space, offset); |
193 |
block = buf_page_hash_get(space, offset); |
194 |
+ if(block) { |
194 |
+ if(block) { |
195 |
+ mutex_enter(&block->mutex); |
195 |
+ mutex_enter(&block->mutex); |
196 |
+ } |
196 |
+ } |
197 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
197 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
198 |
} |
198 |
} |
199 |
|
199 |
|
200 |
if (block == NULL) { |
200 |
if (block == NULL) { |
Lines 248-254
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
248 |
|
248 |
|
249 |
- mutex_enter(&(buf_pool->mutex)); |
249 |
- mutex_enter(&(buf_pool->mutex)); |
250 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
250 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
251 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
251 |
+ rw_lock_x_lock(&(buf_pool->hash_latch)); |
252 |
mutex_enter(&block->mutex); |
252 |
mutex_enter(&block->mutex); |
253 |
|
253 |
|
254 |
if (fil_tablespace_deleted_or_being_deleted_in_mem(space, |
254 |
if (fil_tablespace_deleted_or_being_deleted_in_mem(space, |
Lines 258-264
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
258 |
mutex_exit(&block->mutex); |
258 |
mutex_exit(&block->mutex); |
259 |
- mutex_exit(&(buf_pool->mutex)); |
259 |
- mutex_exit(&(buf_pool->mutex)); |
260 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
260 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
261 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
261 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
262 |
|
262 |
|
263 |
buf_block_free(block); |
263 |
buf_block_free(block); |
264 |
|
264 |
|
Lines 266-272
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
266 |
ut_ad(block); |
266 |
ut_ad(block); |
267 |
|
267 |
|
268 |
buf_page_init(space, offset, block); |
268 |
buf_page_init(space, offset, block); |
269 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
269 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
270 |
|
270 |
|
271 |
/* The block must be put to the LRU list, to the old blocks */ |
271 |
/* The block must be put to the LRU list, to the old blocks */ |
272 |
|
272 |
|
Lines 283-289
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
283 |
|
283 |
|
284 |
- mutex_enter(&(buf_pool->mutex)); |
284 |
- mutex_enter(&(buf_pool->mutex)); |
285 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
285 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
286 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
286 |
+ rw_lock_x_lock(&(buf_pool->hash_latch)); |
287 |
|
287 |
|
288 |
block = buf_page_hash_get(space, offset); |
288 |
block = buf_page_hash_get(space, offset); |
289 |
|
289 |
|
Lines 293-299
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
293 |
/* Page can be found in buf_pool */ |
293 |
/* Page can be found in buf_pool */ |
294 |
- mutex_exit(&(buf_pool->mutex)); |
294 |
- mutex_exit(&(buf_pool->mutex)); |
295 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
295 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
296 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
296 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
297 |
|
297 |
|
298 |
buf_block_free(free_block); |
298 |
buf_block_free(free_block); |
299 |
|
299 |
|
Lines 301-307
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
301 |
mutex_enter(&block->mutex); |
301 |
mutex_enter(&block->mutex); |
302 |
|
302 |
|
303 |
buf_page_init(space, offset, block); |
303 |
buf_page_init(space, offset, block); |
304 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
304 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
305 |
|
305 |
|
306 |
/* The block must be put to the LRU list */ |
306 |
/* The block must be put to the LRU list */ |
307 |
buf_LRU_add_block(block, FALSE); |
307 |
buf_LRU_add_block(block, FALSE); |
Lines 438-444
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
438 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
438 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
439 |
+ mutex_enter(&(buf_pool->flush_list_mutex)); |
439 |
+ mutex_enter(&(buf_pool->flush_list_mutex)); |
440 |
+ mutex_enter(&(buf_pool->free_mutex)); |
440 |
+ mutex_enter(&(buf_pool->free_mutex)); |
441 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
441 |
+ rw_lock_x_lock(&(buf_pool->hash_latch)); |
442 |
+ |
442 |
+ |
443 |
mutex_enter(&(buf_pool->mutex)); |
443 |
mutex_enter(&(buf_pool->mutex)); |
444 |
+ n_single_flush_tmp = buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]; |
444 |
+ n_single_flush_tmp = buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]; |
Lines 463-469
diff -r 2e0c46e78b50 innobase/buf/buf0buf.c
Link Here
|
463 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
463 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
464 |
+ mutex_exit(&(buf_pool->flush_list_mutex)); |
464 |
+ mutex_exit(&(buf_pool->flush_list_mutex)); |
465 |
+ mutex_exit(&(buf_pool->free_mutex)); |
465 |
+ mutex_exit(&(buf_pool->free_mutex)); |
466 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
466 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
467 |
|
467 |
|
468 |
ut_a(buf_LRU_validate()); |
468 |
ut_a(buf_LRU_validate()); |
469 |
ut_a(buf_flush_validate()); |
469 |
ut_a(buf_flush_validate()); |
Lines 604-610
diff -r 2e0c46e78b50 innobase/buf/buf0flu.c
Link Here
|
604 |
|| flush_type == BUF_FLUSH_SINGLE_PAGE); |
604 |
|| flush_type == BUF_FLUSH_SINGLE_PAGE); |
605 |
|
605 |
|
606 |
- mutex_enter(&(buf_pool->mutex)); |
606 |
- mutex_enter(&(buf_pool->mutex)); |
607 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
607 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
608 |
|
608 |
|
609 |
block = buf_page_hash_get(space, offset); |
609 |
block = buf_page_hash_get(space, offset); |
610 |
|
610 |
|
Lines 612-624
diff -r 2e0c46e78b50 innobase/buf/buf0flu.c
Link Here
|
612 |
|
612 |
|
613 |
if (!block) { |
613 |
if (!block) { |
614 |
- mutex_exit(&(buf_pool->mutex)); |
614 |
- mutex_exit(&(buf_pool->mutex)); |
615 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
615 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
616 |
return(0); |
616 |
return(0); |
617 |
} |
617 |
} |
618 |
|
618 |
|
619 |
mutex_enter(&block->mutex); |
619 |
mutex_enter(&block->mutex); |
620 |
+ mutex_enter(&(buf_pool->mutex)); |
620 |
+ mutex_enter(&(buf_pool->mutex)); |
621 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
621 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
622 |
|
622 |
|
623 |
if (flush_type == BUF_FLUSH_LIST |
623 |
if (flush_type == BUF_FLUSH_LIST |
624 |
&& buf_flush_ready_for_flush(block, flush_type)) { |
624 |
&& buf_flush_ready_for_flush(block, flush_type)) { |
Lines 627-633
diff -r 2e0c46e78b50 innobase/buf/buf0flu.c
Link Here
|
627 |
} |
627 |
} |
628 |
|
628 |
|
629 |
- mutex_enter(&(buf_pool->mutex)); |
629 |
- mutex_enter(&(buf_pool->mutex)); |
630 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
630 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
631 |
|
631 |
|
632 |
for (i = low; i < high; i++) { |
632 |
for (i = low; i < high; i++) { |
633 |
|
633 |
|
Lines 636-642
diff -r 2e0c46e78b50 innobase/buf/buf0flu.c
Link Here
|
636 |
mutex_exit(&block->mutex); |
636 |
mutex_exit(&block->mutex); |
637 |
|
637 |
|
638 |
- mutex_exit(&(buf_pool->mutex)); |
638 |
- mutex_exit(&(buf_pool->mutex)); |
639 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
639 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
640 |
|
640 |
|
641 |
/* Note: as we release the buf_pool mutex |
641 |
/* Note: as we release the buf_pool mutex |
642 |
above, in buf_flush_try_page we cannot be sure |
642 |
above, in buf_flush_try_page we cannot be sure |
Lines 645-651
diff -r 2e0c46e78b50 innobase/buf/buf0flu.c
Link Here
|
645 |
flush_type); |
645 |
flush_type); |
646 |
|
646 |
|
647 |
- mutex_enter(&(buf_pool->mutex)); |
647 |
- mutex_enter(&(buf_pool->mutex)); |
648 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
648 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
649 |
} else { |
649 |
} else { |
650 |
mutex_exit(&block->mutex); |
650 |
mutex_exit(&block->mutex); |
651 |
} |
651 |
} |
Lines 653-659
diff -r 2e0c46e78b50 innobase/buf/buf0flu.c
Link Here
|
653 |
} |
653 |
} |
654 |
|
654 |
|
655 |
- mutex_exit(&(buf_pool->mutex)); |
655 |
- mutex_exit(&(buf_pool->mutex)); |
656 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
656 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
657 |
|
657 |
|
658 |
return(count); |
658 |
return(count); |
659 |
} |
659 |
} |
Lines 781-787
diff -r 2e0c46e78b50 innobase/buf/buf0lru.c
Link Here
|
781 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
781 |
+ mutex_enter(&(buf_pool->LRU_mutex)); |
782 |
+ mutex_enter(&(buf_pool->flush_list_mutex)); |
782 |
+ mutex_enter(&(buf_pool->flush_list_mutex)); |
783 |
+ mutex_enter(&(buf_pool->free_mutex)); |
783 |
+ mutex_enter(&(buf_pool->free_mutex)); |
784 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
784 |
+ rw_lock_x_lock(&(buf_pool->hash_latch)); |
785 |
|
785 |
|
786 |
all_freed = TRUE; |
786 |
all_freed = TRUE; |
787 |
|
787 |
|
Lines 793-799
diff -r 2e0c46e78b50 innobase/buf/buf0lru.c
Link Here
|
793 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
793 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
794 |
+ mutex_exit(&(buf_pool->flush_list_mutex)); |
794 |
+ mutex_exit(&(buf_pool->flush_list_mutex)); |
795 |
+ mutex_exit(&(buf_pool->free_mutex)); |
795 |
+ mutex_exit(&(buf_pool->free_mutex)); |
796 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
796 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
797 |
|
797 |
|
798 |
/* Note that the following call will acquire |
798 |
/* Note that the following call will acquire |
799 |
an S-latch on the page */ |
799 |
an S-latch on the page */ |
Lines 805-811
diff -r 2e0c46e78b50 innobase/buf/buf0lru.c
Link Here
|
805 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
805 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
806 |
+ mutex_exit(&(buf_pool->flush_list_mutex)); |
806 |
+ mutex_exit(&(buf_pool->flush_list_mutex)); |
807 |
+ mutex_exit(&(buf_pool->free_mutex)); |
807 |
+ mutex_exit(&(buf_pool->free_mutex)); |
808 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
808 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
809 |
|
809 |
|
810 |
if (!all_freed) { |
810 |
if (!all_freed) { |
811 |
os_thread_sleep(20000); |
811 |
os_thread_sleep(20000); |
Lines 861-871
diff -r 2e0c46e78b50 innobase/buf/buf0lru.c
Link Here
|
861 |
+ |
861 |
+ |
862 |
+ mutex_enter(&(buf_pool->LRU_mutex));/* optimistic */ |
862 |
+ mutex_enter(&(buf_pool->LRU_mutex));/* optimistic */ |
863 |
+ |
863 |
+ |
864 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
864 |
+ rw_lock_x_lock(&(buf_pool->hash_latch)); |
865 |
+ mutex_enter(&block->mutex); |
865 |
+ mutex_enter(&block->mutex); |
866 |
+ if(block->in_LRU_list && buf_flush_ready_for_replace(block)) { |
866 |
+ if(block->in_LRU_list && buf_flush_ready_for_replace(block)) { |
867 |
buf_LRU_block_remove_hashed_page(block); |
867 |
buf_LRU_block_remove_hashed_page(block); |
868 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
868 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
869 |
|
869 |
|
870 |
- mutex_exit(&(buf_pool->mutex)); |
870 |
- mutex_exit(&(buf_pool->mutex)); |
871 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
871 |
+ mutex_exit(&(buf_pool->LRU_mutex)); |
Lines 889-895
diff -r 2e0c46e78b50 innobase/buf/buf0lru.c
Link Here
|
889 |
+ } else { /* someone may interrupt...??? */ |
889 |
+ } else { /* someone may interrupt...??? */ |
890 |
+ mutex_exit(&(buf_pool->LRU_mutex));/* optimistic */ |
890 |
+ mutex_exit(&(buf_pool->LRU_mutex));/* optimistic */ |
891 |
+ |
891 |
+ |
892 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
892 |
+ rw_lock_x_unlock(&(buf_pool->hash_latch)); |
893 |
+ |
893 |
+ |
894 |
+ if (!(block->in_LRU_list)) { |
894 |
+ if (!(block->in_LRU_list)) { |
895 |
+ mutex_exit(&block->mutex); |
895 |
+ mutex_exit(&block->mutex); |
Lines 951-956
diff -r 2e0c46e78b50 innobase/buf/buf0lru.c
Link Here
|
951 |
|
951 |
|
952 |
if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) |
952 |
if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) |
953 |
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 20) { |
953 |
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 20) { |
|
|
954 |
@@ -409,7 +449,7 @@ |
955 |
/* If there is a block in the free list, take it */ |
956 |
if (UT_LIST_GET_LEN(buf_pool->free) > 0) { |
957 |
|
958 |
- block = UT_LIST_GET_FIRST(buf_pool->free); |
959 |
+ block = UT_LIST_GET_LAST(buf_pool->free); |
960 |
ut_a(block->in_free_list); |
961 |
UT_LIST_REMOVE(free, buf_pool->free, block); |
962 |
block->in_free_list = FALSE; |
954 |
@@ -437,7 +477,7 @@ |
963 |
@@ -437,7 +477,7 @@ |
955 |
|
964 |
|
956 |
mutex_exit(&block->mutex); |
965 |
mutex_exit(&block->mutex); |
Lines 1036-1042
diff -r 2e0c46e78b50 innobase/buf/buf0rea.c
Link Here
|
1036 |
/* Count how many blocks in the area have been recently accessed, |
1045 |
/* Count how many blocks in the area have been recently accessed, |
1037 |
that is, reside near the start of the LRU list. */ |
1046 |
that is, reside near the start of the LRU list. */ |
1038 |
|
1047 |
|
1039 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
1048 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
1040 |
for (i = low; i < high; i++) { |
1049 |
for (i = low; i < high; i++) { |
1041 |
block = buf_page_hash_get(space, i); |
1050 |
block = buf_page_hash_get(space, i); |
1042 |
|
1051 |
|
Lines 1044-1050
diff -r 2e0c46e78b50 innobase/buf/buf0rea.c
Link Here
|
1044 |
recent_blocks++; |
1053 |
recent_blocks++; |
1045 |
} |
1054 |
} |
1046 |
} |
1055 |
} |
1047 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
1056 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
1048 |
|
1057 |
|
1049 |
- mutex_exit(&(buf_pool->mutex)); |
1058 |
- mutex_exit(&(buf_pool->mutex)); |
1050 |
+ // mutex_exit(&(buf_pool->mutex)); |
1059 |
+ // mutex_exit(&(buf_pool->mutex)); |
Lines 1072-1078
diff -r 2e0c46e78b50 innobase/buf/buf0rea.c
Link Here
|
1072 |
|
1081 |
|
1073 |
fail_count = 0; |
1082 |
fail_count = 0; |
1074 |
|
1083 |
|
1075 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
1084 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
1076 |
for (i = low; i < high; i++) { |
1085 |
for (i = low; i < high; i++) { |
1077 |
block = buf_page_hash_get(space, i); |
1086 |
block = buf_page_hash_get(space, i); |
1078 |
|
1087 |
|
Lines 1080-1086
diff -r 2e0c46e78b50 innobase/buf/buf0rea.c
Link Here
|
1080 |
pred_block = block; |
1089 |
pred_block = block; |
1081 |
} |
1090 |
} |
1082 |
} |
1091 |
} |
1083 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
1092 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
1084 |
|
1093 |
|
1085 |
if (fail_count > BUF_READ_AHEAD_LINEAR_AREA - |
1094 |
if (fail_count > BUF_READ_AHEAD_LINEAR_AREA - |
1086 |
BUF_READ_AHEAD_LINEAR_THRESHOLD) { |
1095 |
BUF_READ_AHEAD_LINEAR_THRESHOLD) { |
Lines 1095-1106
diff -r 2e0c46e78b50 innobase/buf/buf0rea.c
Link Here
|
1095 |
/* If we got this far, we know that enough pages in the area have |
1104 |
/* If we got this far, we know that enough pages in the area have |
1096 |
been accessed in the right order: linear read-ahead can be sensible */ |
1105 |
been accessed in the right order: linear read-ahead can be sensible */ |
1097 |
|
1106 |
|
1098 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
1107 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
1099 |
block = buf_page_hash_get(space, offset); |
1108 |
block = buf_page_hash_get(space, offset); |
1100 |
|
1109 |
|
1101 |
if (block == NULL) { |
1110 |
if (block == NULL) { |
1102 |
- mutex_exit(&(buf_pool->mutex)); |
1111 |
- mutex_exit(&(buf_pool->mutex)); |
1103 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
1112 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
1104 |
|
1113 |
|
1105 |
return(0); |
1114 |
return(0); |
1106 |
} |
1115 |
} |
Lines 1109-1115
diff -r 2e0c46e78b50 innobase/buf/buf0rea.c
Link Here
|
1109 |
succ_offset = fil_page_get_next(frame); |
1118 |
succ_offset = fil_page_get_next(frame); |
1110 |
|
1119 |
|
1111 |
- mutex_exit(&(buf_pool->mutex)); |
1120 |
- mutex_exit(&(buf_pool->mutex)); |
1112 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
1121 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
1113 |
|
1122 |
|
1114 |
if ((offset == low) && (succ_offset == offset + 1)) { |
1123 |
if ((offset == low) && (succ_offset == offset + 1)) { |
1115 |
|
1124 |
|
Lines 1147-1153
diff -r 2e0c46e78b50 innobase/include/buf0buf.h
Link Here
|
1147 |
mem_heap_t* io_counter_heap; |
1156 |
mem_heap_t* io_counter_heap; |
1148 |
ulint io_counters; |
1157 |
ulint io_counters; |
1149 |
hash_table_t* page_hash; /* hash table of the file pages */ |
1158 |
hash_table_t* page_hash; /* hash table of the file pages */ |
1150 |
+ mutex_t hash_mutex; |
1159 |
+ rw_lock_t hash_latch; |
1151 |
|
1160 |
|
1152 |
ulint n_pend_reads; /* number of pending read operations */ |
1161 |
ulint n_pend_reads; /* number of pending read operations */ |
1153 |
|
1162 |
|
Lines 1284-1295
diff -r 2e0c46e78b50 innobase/log/log0recv.c
Link Here
|
1284 |
mtr_start(&mtr); |
1293 |
mtr_start(&mtr); |
1285 |
|
1294 |
|
1286 |
- mutex_enter(&(buf_pool->mutex)); |
1295 |
- mutex_enter(&(buf_pool->mutex)); |
1287 |
+ mutex_enter(&(buf_pool->hash_mutex)); |
1296 |
+ rw_lock_s_lock(&(buf_pool->hash_latch)); |
1288 |
|
1297 |
|
1289 |
page = buf_page_hash_get(space, page_no)->frame; |
1298 |
page = buf_page_hash_get(space, page_no)->frame; |
1290 |
|
1299 |
|
1291 |
- mutex_exit(&(buf_pool->mutex)); |
1300 |
- mutex_exit(&(buf_pool->mutex)); |
1292 |
+ mutex_exit(&(buf_pool->hash_mutex)); |
1301 |
+ rw_lock_s_unlock(&(buf_pool->hash_latch)); |
1293 |
|
1302 |
|
1294 |
replica = buf_page_get(space + RECV_REPLICA_SPACE_ADD, page_no, |
1303 |
replica = buf_page_get(space + RECV_REPLICA_SPACE_ADD, page_no, |
1295 |
RW_X_LATCH, &mtr); |
1304 |
RW_X_LATCH, &mtr); |