~vlad-lesin/percona-server/pintables

« back to all changes in this revision

Viewing changes to innodb_split_buf_pool_mutex.patch

  • Committer: Laurynas Biveinis
  • Date: 2011-06-21 02:36:36 UTC
  • mfrom: (123 merge)
  • mto: This revision was merged to the branch mainline in revision 124.
  • Revision ID: laurynas.biveinis@percona.com-20110621023636-ccp1iyyrncj181zt
MergeĀ fromĀ lp:percona-server

Show diffs side-by-side

added added

removed removed

Lines of Context:
2282
2282
        return(count);
2283
2283
 }
2284
2284
@@ -1722,13 +1754,15 @@
2285
 
              || sync_thread_levels_empty_gen(TRUE));
 
2285
              || sync_thread_levels_empty_except_dict());
2286
2286
 #endif /* UNIV_SYNC_DEBUG */
2287
2287
 
2288
2288
-       buf_pool_mutex_enter(buf_pool);
3033
3033
                        b->state = b->oldest_modification
3034
3034
                                ? BUF_BLOCK_ZIP_DIRTY
3035
3035
                                : BUF_BLOCK_ZIP_PAGE;
3036
 
@@ -1614,7 +1748,9 @@
 
3036
@@ -1597,6 +1731,7 @@
 
3037
                                buf_LRU_add_block_low(b, buf_page_is_old(b));
 
3038
                        }
 
3039
 
 
3040
+                       mutex_enter(&buf_pool->zip_mutex);
 
3041
                        if (b->state == BUF_BLOCK_ZIP_PAGE) {
 
3042
                                buf_LRU_insert_zip_clean(b);
 
3043
                        } else {
 
3044
@@ -1612,9 +1747,12 @@
 
3045
                        buf_pool->mutex and block_mutex. */
 
3046
                        b->buf_fix_count++;
3037
3047
                        b->io_fix = BUF_IO_READ;
 
3048
+                       mutex_exit(&buf_pool->zip_mutex);
3038
3049
                }
3039
3050
 
3040
3051
-               buf_pool_mutex_exit(buf_pool);
3044
3055
                mutex_exit(block_mutex);
3045
3056
 
3046
3057
                /* Remove possible adaptive hash index on the page.
3047
 
@@ -1646,7 +1782,9 @@
 
3058
@@ -1646,7 +1784,9 @@
3048
3059
                                : BUF_NO_CHECKSUM_MAGIC);
3049
3060
                }
3050
3061
 
3055
3066
                mutex_enter(block_mutex);
3056
3067
 
3057
3068
                if (b) {
3058
 
@@ -1656,13 +1794,17 @@
 
3069
@@ -1656,13 +1796,17 @@
3059
3070
                        mutex_exit(&buf_pool->zip_mutex);
3060
3071
                }
3061
3072
 
3074
3085
        }
3075
3086
 
3076
3087
        return(BUF_LRU_FREED);
3077
 
@@ -1674,13 +1816,14 @@
 
3088
@@ -1674,13 +1818,14 @@
3078
3089
 void
3079
3090
 buf_LRU_block_free_non_file_page(
3080
3091
 /*=============================*/
3091
3102
        ut_ad(mutex_own(&block->mutex));
3092
3103
 
3093
3104
        switch (buf_block_get_state(block)) {
3094
 
@@ -1714,18 +1857,21 @@
 
3105
@@ -1714,18 +1859,21 @@
3095
3106
        if (data) {
3096
3107
                block->page.zip.data = NULL;
3097
3108
                mutex_exit(&block->mutex);
3117
3128
 
3118
3129
        UNIV_MEM_ASSERT_AND_FREE(block->frame, UNIV_PAGE_SIZE);
3119
3130
 }
3120
 
@@ -1755,7 +1901,11 @@
 
3131
@@ -1755,7 +1903,11 @@
3121
3132
        buf_pool_t*             buf_pool = buf_pool_from_bpage(bpage);
3122
3133
 
3123
3134
        ut_ad(bpage);
3130
3141
        ut_ad(mutex_own(buf_page_get_mutex(bpage)));
3131
3142
 
3132
3143
        ut_a(buf_page_get_io_fix(bpage) == BUF_IO_NONE);
3133
 
@@ -1863,7 +2013,9 @@
 
3144
@@ -1863,7 +2015,9 @@
3134
3145
 
3135
3146
 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3136
3147
                mutex_exit(buf_page_get_mutex(bpage));
3141
3152
                buf_print();
3142
3153
                buf_LRU_print();
3143
3154
                buf_validate();
3144
 
@@ -1884,18 +2036,18 @@
 
3155
@@ -1884,18 +2038,18 @@
3145
3156
                ut_a(bpage->zip.data);
3146
3157
                ut_a(buf_page_get_zip_size(bpage));
3147
3158
 
3165
3176
 
3166
3177
                UNIV_MEM_UNDESC(bpage);
3167
3178
                return(BUF_BLOCK_ZIP_FREE);
3168
 
@@ -1918,13 +2070,13 @@
 
3179
@@ -1918,13 +2072,13 @@
3169
3180
                        ut_ad(!bpage->in_flush_list);
3170
3181
                        ut_ad(!bpage->in_LRU_list);
3171
3182
                        mutex_exit(&((buf_block_t*) bpage)->mutex);
3182
3193
                        mutex_enter(&((buf_block_t*) bpage)->mutex);
3183
3194
                        page_zip_set_size(&bpage->zip, 0);
3184
3195
                }
3185
 
@@ -1950,18 +2102,19 @@
 
3196
@@ -1950,18 +2104,19 @@
3186
3197
 void
3187
3198
 buf_LRU_block_free_hashed_page(
3188
3199
 /*===========================*/
3206
3217
 }
3207
3218
 
3208
3219
 /**********************************************************************//**
3209
 
@@ -1988,7 +2141,8 @@
 
3220
@@ -1988,7 +2143,8 @@
3210
3221
        }
3211
3222
 
3212
3223
        if (adjust) {
3216
3227
 
3217
3228
                if (ratio != buf_pool->LRU_old_ratio) {
3218
3229
                        buf_pool->LRU_old_ratio = ratio;
3219
 
@@ -2000,7 +2154,8 @@
 
3230
@@ -2000,7 +2156,8 @@
3220
3231
                        }
3221
3232
                }
3222
3233
 
3226
3237
        } else {
3227
3238
                buf_pool->LRU_old_ratio = ratio;
3228
3239
        }
3229
 
@@ -2105,7 +2260,8 @@
 
3240
@@ -2105,7 +2262,8 @@
3230
3241
        ulint           new_len;
3231
3242
 
3232
3243
        ut_ad(buf_pool);
3236
3247
 
3237
3248
        if (UT_LIST_GET_LEN(buf_pool->LRU) >= BUF_LRU_OLD_MIN_LEN) {
3238
3249
 
3239
 
@@ -2166,16 +2322,22 @@
 
3250
@@ -2166,16 +2324,22 @@
3240
3251
 
3241
3252
        ut_a(buf_pool->LRU_old_len == old_len);
3242
3253
 
3261
3272
        UT_LIST_VALIDATE(unzip_LRU, buf_block_t, buf_pool->unzip_LRU,
3262
3273
                         ut_ad(ut_list_node_313->in_unzip_LRU_list
3263
3274
                               && ut_list_node_313->page.in_LRU_list));
3264
 
@@ -2189,7 +2351,8 @@
 
3275
@@ -2189,7 +2353,8 @@
3265
3276
                ut_a(buf_page_belongs_to_unzip_LRU(&block->page));
3266
3277
        }
3267
3278
 
3271
3282
 }
3272
3283
 
3273
3284
 /**********************************************************************//**
3274
 
@@ -2225,7 +2388,8 @@
 
3285
@@ -2225,7 +2390,8 @@
3275
3286
        const buf_page_t*       bpage;
3276
3287
 
3277
3288
        ut_ad(buf_pool);
3281
3292
 
3282
3293
        bpage = UT_LIST_GET_FIRST(buf_pool->LRU);
3283
3294
 
3284
 
@@ -2282,7 +2446,8 @@
 
3295
@@ -2282,7 +2448,8 @@
3285
3296
                bpage = UT_LIST_GET_NEXT(LRU, bpage);
3286
3297
        }
3287
3298
 
3388
3399
diff -ruN a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
3389
3400
--- a/storage/innobase/ibuf/ibuf0ibuf.c 2010-12-03 15:48:03.068954202 +0900
3390
3401
+++ b/storage/innobase/ibuf/ibuf0ibuf.c 2010-12-03 15:48:29.335988682 +0900
3391
 
@@ -3832,9 +3832,11 @@
 
3402
@@ -3821,9 +3821,11 @@
3392
3403
                ulint           fold = buf_page_address_fold(space, page_no);
3393
3404
                buf_pool_t*     buf_pool = buf_pool_get(space, page_no);
3394
3405
 
3897
3908
 extern mysql_pfs_key_t cache_last_read_mutex_key;
3898
3909
 extern mysql_pfs_key_t dict_foreign_err_mutex_key;
3899
3910
 extern mysql_pfs_key_t dict_sys_mutex_key;
3900
 
@@ -659,7 +663,7 @@
 
3911
@@ -668,7 +672,7 @@
3901
3912
 #define SYNC_TRX_SYS_HEADER    290
3902
3913
 #define        SYNC_PURGE_QUEUE        200
3903
3914
 #define SYNC_LOG               170
3906
3917
 #define SYNC_RECV              168
3907
3918
 #define        SYNC_WORK_QUEUE         162
3908
3919
 #define        SYNC_SEARCH_SYS_CONF    161     /* for assigning btr_search_enabled */
3909
 
@@ -669,8 +673,13 @@
 
3920
@@ -678,8 +682,13 @@
3910
3921
                                        SYNC_SEARCH_SYS, as memory allocation
3911
3922
                                        can call routines there! Otherwise
3912
3923
                                        the level is SYNC_MEM_HASH. */
3921
3932
 #define        SYNC_BUF_FLUSH_LIST     145     /* Buffer flush list mutex */
3922
3933
 #define SYNC_DOUBLEWRITE       140
3923
3934
 #define        SYNC_ANY_LATCH          135
3924
 
@@ -702,7 +711,7 @@
 
3935
@@ -711,7 +720,7 @@
3925
3936
                os_fast_mutex;  /*!< We use this OS mutex in place of lock_word
3926
3937
                                when atomic operations are not enabled */
3927
3938
 #endif
3933
3944
diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
3934
3945
--- a/storage/innobase/srv/srv0srv.c    2010-12-03 15:48:03.080956216 +0900
3935
3946
+++ b/storage/innobase/srv/srv0srv.c    2010-12-03 15:48:29.355023766 +0900
3936
 
@@ -3089,7 +3089,7 @@
 
3947
@@ -3098,7 +3098,7 @@
3937
3948
                                                                level += log_sys->max_checkpoint_age
3938
3949
                                                                         - (lsn - oldest_modification);
3939
3950
                                                        }
3942
3953
                                                        n_blocks++;
3943
3954
                                                }
3944
3955
 
3945
 
@@ -3175,7 +3175,7 @@
 
3956
@@ -3184,7 +3184,7 @@
3946
3957
                                                        found = TRUE;
3947
3958
                                                        break;
3948
3959
                                                }
3987
3998
 }
3988
3999
 
3989
4000
 /******************************************************************//**
3990
 
@@ -1189,7 +1199,12 @@
 
4001
@@ -1234,7 +1244,12 @@
3991
4002
                        ut_error;
3992
4003
                }
3993
4004
                break;
4000
4011
        case SYNC_BUF_POOL:
4001
4012
                /* We can have multiple mutexes of this type therefore we
4002
4013
                can only check whether the greater than condition holds. */
4003
 
@@ -1207,7 +1222,8 @@
 
4014
@@ -1252,7 +1267,8 @@
4004
4015
                buffer block (block->mutex or buf_pool->zip_mutex). */
4005
4016
                if (!sync_thread_levels_g(array, level, FALSE)) {
4006
4017
                        ut_a(sync_thread_levels_g(array, level - 1, TRUE));