This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define CHANGED_BLOCKS_HASH 128 |
| typedef struct st_block_link BLOCK_LINK |
Definition at line 26 of file keycache.h.
| typedef struct st_hash_link HASH_LINK |
Definition at line 30 of file keycache.h.
| typedef struct st_key_cache KEY_CACHE |
| typedef struct st_keycache_page KEYCACHE_PAGE |
Definition at line 28 of file keycache.h.
| typedef struct st_keycache_wqueue KEYCACHE_WQUEUE |
Definition at line 592 of file mf_keycache.c.
References st_key_cache::age_threshold, st_key_cache::cache_lock, DBUG_ENTER, DBUG_VOID_RETURN, st_key_cache::disk_blocks, keycache_pthread_mutex_lock, keycache_pthread_mutex_unlock, and st_key_cache::min_warm_blocks.
Referenced by ha_change_key_cache_param(), and resize_key_cache().
00594 { 00595 DBUG_ENTER("change_key_cache_param"); 00596 00597 keycache_pthread_mutex_lock(&keycache->cache_lock); 00598 if (division_limit) 00599 keycache->min_warm_blocks= (keycache->disk_blocks * 00600 division_limit / 100 + 1); 00601 if (age_threshold) 00602 keycache->age_threshold= (keycache->disk_blocks * 00603 age_threshold / 100); 00604 keycache_pthread_mutex_unlock(&keycache->cache_lock); 00605 DBUG_VOID_RETURN; 00606 }
Here is the caller graph for this function:

Definition at line 621 of file mf_keycache.c.
References st_key_cache::block_mem, st_key_cache::block_root, st_key_cache::blocks_changed, st_key_cache::blocks_used, st_key_cache::cache_lock, st_key_cache::can_be_used, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, st_key_cache::disk_blocks, st_key_cache::global_blocks_changed, st_key_cache::global_cache_r_requests, st_key_cache::global_cache_read, st_key_cache::global_cache_w_requests, st_key_cache::global_cache_write, st_key_cache::key_cache_inited, KEYCACHE_DEBUG_CLOSE, my_free, my_large_free, MYF, NULL, and pthread_mutex_destroy.
Referenced by flush_blocks(), ha_end_key_cache(), main(), and resize_key_cache().
00622 { 00623 DBUG_ENTER("end_key_cache"); 00624 DBUG_PRINT("enter", ("key_cache: 0x%lx", keycache)); 00625 00626 if (!keycache->key_cache_inited) 00627 DBUG_VOID_RETURN; 00628 00629 if (keycache->disk_blocks > 0) 00630 { 00631 if (keycache->block_mem) 00632 { 00633 my_large_free((gptr) keycache->block_mem, MYF(0)); 00634 keycache->block_mem= NULL; 00635 my_free((gptr) keycache->block_root, MYF(0)); 00636 keycache->block_root= NULL; 00637 } 00638 keycache->disk_blocks= -1; 00639 /* Reset blocks_changed to be safe if flush_all_key_blocks is called */ 00640 keycache->blocks_changed= 0; 00641 } 00642 00643 DBUG_PRINT("status", ("used: %d changed: %d w_requests: %lu " 00644 "writes: %lu r_requests: %lu reads: %lu", 00645 keycache->blocks_used, keycache->global_blocks_changed, 00646 (ulong) keycache->global_cache_w_requests, 00647 (ulong) keycache->global_cache_write, 00648 (ulong) keycache->global_cache_r_requests, 00649 (ulong) keycache->global_cache_read)); 00650 00651 if (cleanup) 00652 { 00653 pthread_mutex_destroy(&keycache->cache_lock); 00654 keycache->key_cache_inited= keycache->can_be_used= 0; 00655 KEYCACHE_DEBUG_CLOSE; 00656 } 00657 DBUG_VOID_RETURN; 00658 } /* end_key_cache */
Here is the caller graph for this function:

| int flush_key_blocks | ( | KEY_CACHE * | keycache, | |
| int | file, | |||
| enum flush_type | type | |||
| ) |
Definition at line 2544 of file mf_keycache.c.
References st_key_cache::cache_lock, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, dec_counter_for_resize_op(), st_key_cache::disk_blocks, flush_key_blocks_int(), inc_counter_for_resize_op(), keycache_pthread_mutex_lock, and keycache_pthread_mutex_unlock.
Referenced by _mi_test_if_changed(), chk_size(), flush_blocks(), mi_assign_to_key_cache(), mi_close(), mi_delete_all_rows(), mi_lock_database(), mi_panic(), mi_preload(), mi_repair_by_sort(), mi_repair_parallel(), and mi_sort_index().
02546 { 02547 int res; 02548 DBUG_ENTER("flush_key_blocks"); 02549 DBUG_PRINT("enter", ("keycache: 0x%lx", keycache)); 02550 02551 if (keycache->disk_blocks <= 0) 02552 DBUG_RETURN(0); 02553 keycache_pthread_mutex_lock(&keycache->cache_lock); 02554 inc_counter_for_resize_op(keycache); 02555 res= flush_key_blocks_int(keycache, file, type); 02556 dec_counter_for_resize_op(keycache); 02557 keycache_pthread_mutex_unlock(&keycache->cache_lock); 02558 DBUG_RETURN(res); 02559 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int init_key_cache | ( | KEY_CACHE * | keycache, | |
| uint | key_cache_block_size, | |||
| ulong | use_mem, | |||
| uint | division_limit, | |||
| uint | age_threshold | |||
| ) |
Definition at line 288 of file mf_keycache.c.
References st_key_cache::age_threshold, ALIGN_SIZE, st_key_cache::block_mem, st_key_cache::block_root, st_key_cache::blocks, st_key_cache::blocks_available, st_key_cache::blocks_changed, st_key_cache::blocks_unused, st_key_cache::blocks_used, bzero, st_key_cache::cache_lock, st_key_cache::can_be_used, st_key_cache::changed_blocks, CHANGED_BLOCKS_HASH, st_key_cache::cnt_for_resize_op, DBUG_ASSERT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_key_cache::disk_blocks, err, error, st_key_cache::file_blocks, st_key_cache::free_block_list, st_key_cache::free_hash_list, st_key_cache::global_blocks_changed, st_key_cache::global_cache_r_requests, st_key_cache::global_cache_read, st_key_cache::global_cache_w_requests, st_key_cache::global_cache_write, st_key_cache::hash_entries, st_key_cache::hash_link_root, st_key_cache::hash_links, st_key_cache::hash_links_used, st_key_cache::hash_root, st_key_cache::in_init, int(), st_key_cache::key_cache_block_size, st_key_cache::key_cache_inited, st_key_cache::key_cache_mem_size, st_key_cache::key_cache_shift, KEYCACHE_DEBUG_OPEN, st_key_cache::keycache_time, st_keycache_wqueue::last_thread, st_key_cache::min_warm_blocks, my_bit_log2(), my_errno, my_free, my_large_free, my_large_malloc, my_malloc(), MY_MUTEX_INIT_FAST, MY_WME, MYF, next_power(), NULL, pthread_mutex_init, st_key_cache::resize_in_flush, st_key_cache::resize_queue, st_key_cache::used_ins, st_key_cache::used_last, st_key_cache::waiting_for_block, st_key_cache::waiting_for_hash_link, and st_key_cache::warm_blocks.
Referenced by examine_log(), ha_init_key_cache(), main(), mi_repair(), mi_sort_records(), myisamchk(), resize_key_cache(), and start_test().
00291 { 00292 uint blocks, hash_links, length; 00293 int error; 00294 DBUG_ENTER("init_key_cache"); 00295 DBUG_ASSERT(key_cache_block_size >= 512); 00296 00297 KEYCACHE_DEBUG_OPEN; 00298 if (keycache->key_cache_inited && keycache->disk_blocks > 0) 00299 { 00300 DBUG_PRINT("warning",("key cache already in use")); 00301 DBUG_RETURN(0); 00302 } 00303 00304 keycache->global_cache_w_requests= keycache->global_cache_r_requests= 0; 00305 keycache->global_cache_read= keycache->global_cache_write= 0; 00306 keycache->disk_blocks= -1; 00307 if (! keycache->key_cache_inited) 00308 { 00309 keycache->key_cache_inited= 1; 00310 keycache->in_init= 0; 00311 pthread_mutex_init(&keycache->cache_lock, MY_MUTEX_INIT_FAST); 00312 keycache->resize_queue.last_thread= NULL; 00313 } 00314 00315 keycache->key_cache_mem_size= use_mem; 00316 keycache->key_cache_block_size= key_cache_block_size; 00317 keycache->key_cache_shift= my_bit_log2(key_cache_block_size); 00318 DBUG_PRINT("info", ("key_cache_block_size: %u", 00319 key_cache_block_size)); 00320 00321 blocks= (uint) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) + 00322 sizeof(HASH_LINK*) * 5/4 + key_cache_block_size)); 00323 /* It doesn't make sense to have too few blocks (less than 8) */ 00324 if (blocks >= 8 && keycache->disk_blocks < 0) 00325 { 00326 for ( ; ; ) 00327 { 00328 /* Set my_hash_entries to the next bigger 2 power */ 00329 if ((keycache->hash_entries= next_power(blocks)) < blocks * 5/4) 00330 keycache->hash_entries<<= 1; 00331 hash_links= 2 * blocks; 00332 #if defined(MAX_THREADS) 00333 if (hash_links < MAX_THREADS + blocks - 1) 00334 hash_links= MAX_THREADS + blocks - 1; 00335 #endif 00336 while ((length= (ALIGN_SIZE(blocks * sizeof(BLOCK_LINK)) + 00337 ALIGN_SIZE(hash_links * sizeof(HASH_LINK)) + 00338 ALIGN_SIZE(sizeof(HASH_LINK*) * 00339 keycache->hash_entries))) + 00340 ((ulong) blocks << keycache->key_cache_shift) > use_mem) 00341 blocks--; 00342 /* Allocate memory for cache page buffers */ 00343 if ((keycache->block_mem= 00344 my_large_malloc((ulong) blocks * keycache->key_cache_block_size, 00345 MYF(MY_WME)))) 00346 { 00347 /* 00348 Allocate memory for blocks, hash_links and hash entries; 00349 For each block 2 hash links are allocated 00350 */ 00351 if ((keycache->block_root= (BLOCK_LINK*) my_malloc((uint) length, 00352 MYF(0)))) 00353 break; 00354 my_large_free(keycache->block_mem, MYF(0)); 00355 keycache->block_mem= 0; 00356 } 00357 if (blocks < 8) 00358 { 00359 my_errno= ENOMEM; 00360 goto err; 00361 } 00362 blocks= blocks / 4*3; 00363 } 00364 keycache->blocks_unused= (ulong) blocks; 00365 keycache->disk_blocks= (int) blocks; 00366 keycache->hash_links= hash_links; 00367 keycache->hash_root= (HASH_LINK**) ((char*) keycache->block_root + 00368 ALIGN_SIZE(blocks*sizeof(BLOCK_LINK))); 00369 keycache->hash_link_root= (HASH_LINK*) ((char*) keycache->hash_root + 00370 ALIGN_SIZE((sizeof(HASH_LINK*) * 00371 keycache->hash_entries))); 00372 bzero((byte*) keycache->block_root, 00373 keycache->disk_blocks * sizeof(BLOCK_LINK)); 00374 bzero((byte*) keycache->hash_root, 00375 keycache->hash_entries * sizeof(HASH_LINK*)); 00376 bzero((byte*) keycache->hash_link_root, 00377 keycache->hash_links * sizeof(HASH_LINK)); 00378 keycache->hash_links_used= 0; 00379 keycache->free_hash_list= NULL; 00380 keycache->blocks_used= keycache->blocks_changed= 0; 00381 00382 keycache->global_blocks_changed= 0; 00383 keycache->blocks_available=0; /* For debugging */ 00384 00385 /* The LRU chain is empty after initialization */ 00386 keycache->used_last= NULL; 00387 keycache->used_ins= NULL; 00388 keycache->free_block_list= NULL; 00389 keycache->keycache_time= 0; 00390 keycache->warm_blocks= 0; 00391 keycache->min_warm_blocks= (division_limit ? 00392 blocks * division_limit / 100 + 1 : 00393 blocks); 00394 keycache->age_threshold= (age_threshold ? 00395 blocks * age_threshold / 100 : 00396 blocks); 00397 00398 keycache->cnt_for_resize_op= 0; 00399 keycache->resize_in_flush= 0; 00400 keycache->can_be_used= 1; 00401 00402 keycache->waiting_for_hash_link.last_thread= NULL; 00403 keycache->waiting_for_block.last_thread= NULL; 00404 DBUG_PRINT("exit", 00405 ("disk_blocks: %d block_root: 0x%lx hash_entries: %d\ 00406 hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx", 00407 keycache->disk_blocks, keycache->block_root, 00408 keycache->hash_entries, keycache->hash_root, 00409 keycache->hash_links, keycache->hash_link_root)); 00410 bzero((gptr) keycache->changed_blocks, 00411 sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH); 00412 bzero((gptr) keycache->file_blocks, 00413 sizeof(keycache->file_blocks[0]) * CHANGED_BLOCKS_HASH); 00414 } 00415 00416 keycache->blocks= keycache->disk_blocks > 0 ? keycache->disk_blocks : 0; 00417 DBUG_RETURN((int) keycache->disk_blocks); 00418 00419 err: 00420 error= my_errno; 00421 keycache->disk_blocks= 0; 00422 keycache->blocks= 0; 00423 if (keycache->block_mem) 00424 { 00425 my_large_free((gptr) keycache->block_mem, MYF(0)); 00426 keycache->block_mem= NULL; 00427 } 00428 if (keycache->block_root) 00429 { 00430 my_free((gptr) keycache->block_root, MYF(0)); 00431 keycache->block_root= NULL; 00432 } 00433 my_errno= error; 00434 keycache->can_be_used= 0; 00435 DBUG_RETURN(0); 00436 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int key_cache_insert | ( | KEY_CACHE * | keycache, | |
| File | file, | |||
| my_off_t | filepos, | |||
| int | level, | |||
| byte * | buff, | |||
| uint | length | |||
| ) |
Definition at line 1927 of file mf_keycache.c.
References yaSSL::block, BLOCK_ERROR, BLOCK_READ, bmove512, st_key_cache::cache_lock, st_key_cache::can_be_used, COND_FOR_REQUESTED, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, dec_counter_for_resize_op(), error, find_key_block(), st_key_cache::global_cache_r_requests, inc_counter_for_resize_op(), st_key_cache::key_cache_block_size, KEYCACHE_DBUG_ASSERT, KEYCACHE_DBUG_PRINT, keycache_pthread_mutex_lock, keycache_pthread_mutex_unlock, memcpy, offset, PAGE_READ, reg1, remove_reader(), set_if_smaller, and unreg_request().
Referenced by mi_preload().
01930 { 01931 DBUG_ENTER("key_cache_insert"); 01932 DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u", 01933 (uint) file,(ulong) filepos, length)); 01934 01935 if (keycache->can_be_used) 01936 { 01937 /* Key cache is used */ 01938 reg1 BLOCK_LINK *block; 01939 uint read_length; 01940 int page_st; 01941 int error; 01942 uint offset; 01943 01944 offset= (uint) (filepos & (keycache->key_cache_block_size-1)); 01945 do 01946 { 01947 keycache_pthread_mutex_lock(&keycache->cache_lock); 01948 if (!keycache->can_be_used) 01949 { 01950 keycache_pthread_mutex_unlock(&keycache->cache_lock); 01951 DBUG_RETURN(0); 01952 } 01953 /* Read data into key cache from buff in key_cache_block_size incr. */ 01954 filepos-= offset; 01955 read_length= length; 01956 set_if_smaller(read_length, keycache->key_cache_block_size-offset); 01957 KEYCACHE_DBUG_ASSERT(read_length > 0); 01958 01959 inc_counter_for_resize_op(keycache); 01960 keycache->global_cache_r_requests++; 01961 block= find_key_block(keycache, file, filepos, level, 0, &page_st); 01962 if (block->status != BLOCK_ERROR && page_st != PAGE_READ) 01963 { 01964 /* The requested page is to be read into the block buffer */ 01965 #if !defined(SERIALIZED_READ_FROM_CACHE) 01966 keycache_pthread_mutex_unlock(&keycache->cache_lock); 01967 /* 01968 Here other threads may step in and register as secondary readers. 01969 They will register in block->wqueue[COND_FOR_REQUESTED]. 01970 */ 01971 #endif 01972 01973 /* Copy data from buff */ 01974 if (!(read_length & 511)) 01975 bmove512(block->buffer+offset, buff, read_length); 01976 else 01977 memcpy(block->buffer+offset, buff, (size_t) read_length); 01978 01979 #if !defined(SERIALIZED_READ_FROM_CACHE) 01980 keycache_pthread_mutex_lock(&keycache->cache_lock); 01981 /* Here we are alone again. */ 01982 #endif 01983 block->status= BLOCK_READ; 01984 block->length= read_length+offset; 01985 KEYCACHE_DBUG_PRINT("key_cache_insert", 01986 ("primary request: new page in cache")); 01987 #ifdef THREAD 01988 /* Signal that all pending requests for this now can be processed. */ 01989 if (block->wqueue[COND_FOR_REQUESTED].last_thread) 01990 release_queue(&block->wqueue[COND_FOR_REQUESTED]); 01991 #endif 01992 } 01993 01994 remove_reader(block); 01995 /* 01996 Link the block into the LRU chain 01997 if it's the last submitted request for the block 01998 */ 01999 unreg_request(keycache, block, 1); 02000 02001 error= (block->status & BLOCK_ERROR); 02002 02003 dec_counter_for_resize_op(keycache); 02004 02005 keycache_pthread_mutex_unlock(&keycache->cache_lock); 02006 02007 if (error) 02008 DBUG_RETURN(1); 02009 02010 buff+= read_length; 02011 filepos+= read_length+offset; 02012 offset= 0; 02013 02014 } while ((length-= read_length)); 02015 } 02016 DBUG_RETURN(0); 02017 }
Here is the call graph for this function:

Here is the caller graph for this function:

| byte* key_cache_read | ( | KEY_CACHE * | keycache, | |
| File | file, | |||
| my_off_t | filepos, | |||
| int | level, | |||
| byte * | buff, | |||
| uint | length, | |||
| uint | block_length, | |||
| int | return_buffer | |||
| ) |
Referenced by _mi_fetch_keypage(), _mi_new(), and check_k_link().
Here is the caller graph for this function:

Definition at line 360 of file mf_keycaches.c.
References key_cache_hash, and safe_hash_change().
Referenced by mi_change_key_cache().
00362 { 00363 safe_hash_change(&key_cache_hash, (byte*) old_data, (byte*) new_data); 00364 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 329 of file mf_keycaches.c.
References dflt_key_cache, st_safe_hash_with_default::hash, key_cache_hash, st_hash::records, and safe_hash_search().
Referenced by mi_open().
00330 { 00331 if (!key_cache_hash.hash.records) 00332 return dflt_key_cache; 00333 return (KEY_CACHE*) safe_hash_search(&key_cache_hash, key, length); 00334 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 353 of file mf_keycaches.c.
References key_cache_hash, and safe_hash_set().
Referenced by mi_assign_to_key_cache().
00355 { 00356 return safe_hash_set(&key_cache_hash, key, length, (byte*) key_cache); 00357 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void multi_keycache_free | ( | void | ) |
Definition at line 307 of file mf_keycaches.c.
References key_cache_hash, and safe_hash_free().
Referenced by clean_up().
00308 { 00309 safe_hash_free(&key_cache_hash); 00310 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool multi_keycache_init | ( | void | ) |
Definition at line 301 of file mf_keycaches.c.
References dflt_key_cache, key_cache_hash, and safe_hash_init().
Referenced by mysql_init_variables().
00302 { 00303 return safe_hash_init(&key_cache_hash, 16, (byte*) dflt_key_cache); 00304 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int reset_key_cache_counters | ( | const char * | name, | |
| KEY_CACHE * | key_cache | |||
| ) |
Definition at line 2611 of file mf_keycache.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_key_cache::global_blocks_changed, st_key_cache::global_cache_r_requests, st_key_cache::global_cache_read, st_key_cache::global_cache_w_requests, st_key_cache::global_cache_write, and st_key_cache::key_cache_inited.
Referenced by refresh_status().
02612 { 02613 DBUG_ENTER("reset_key_cache_counters"); 02614 if (!key_cache->key_cache_inited) 02615 { 02616 DBUG_PRINT("info", ("Key cache %s not initialized.", name)); 02617 DBUG_RETURN(0); 02618 } 02619 DBUG_PRINT("info", ("Resetting counters for key cache %s.", name)); 02620 02621 key_cache->global_blocks_changed= 0; /* Key_blocks_not_flushed */ 02622 key_cache->global_cache_r_requests= 0; /* Key_read_requests */ 02623 key_cache->global_cache_read= 0; /* Key_reads */ 02624 key_cache->global_cache_w_requests= 0; /* Key_write_requests */ 02625 key_cache->global_cache_write= 0; /* Key_writes */ 02626 DBUG_RETURN(0); 02627 }
Here is the caller graph for this function:

| int resize_key_cache | ( | KEY_CACHE * | keycache, | |
| uint | key_cache_block_size, | |||
| ulong | use_mem, | |||
| uint | division_limit, | |||
| uint | age_threshold | |||
| ) |
Definition at line 468 of file mf_keycache.c.
References st_key_cache::cache_lock, st_key_cache::can_be_used, change_key_cache_param(), st_key_cache::cnt_for_resize_op, DBUG_ENTER, DBUG_RETURN, st_key_cache::disk_blocks, end_key_cache(), flush_all_key_blocks(), st_my_thread_var::id, init_key_cache(), st_key_cache::key_cache_block_size, st_key_cache::key_cache_inited, st_key_cache::key_cache_mem_size, KEYCACHE_DBUG_ASSERT, KEYCACHE_DBUG_PRINT, keycache_pthread_cond_signal, keycache_pthread_cond_wait, keycache_pthread_mutex_lock, keycache_pthread_mutex_unlock, st_keycache_wqueue::last_thread, my_thread_var, st_my_thread_var::next, st_key_cache::resize_in_flush, st_key_cache::resize_queue, and st_my_thread_var::suspend.
Referenced by ha_resize_key_cache(), and main().
00471 { 00472 int blocks; 00473 #ifdef THREAD 00474 struct st_my_thread_var *thread; 00475 KEYCACHE_WQUEUE *wqueue; 00476 #endif 00477 DBUG_ENTER("resize_key_cache"); 00478 00479 if (!keycache->key_cache_inited) 00480 DBUG_RETURN(keycache->disk_blocks); 00481 00482 if(key_cache_block_size == keycache->key_cache_block_size && 00483 use_mem == keycache->key_cache_mem_size) 00484 { 00485 change_key_cache_param(keycache, division_limit, age_threshold); 00486 DBUG_RETURN(keycache->disk_blocks); 00487 } 00488 00489 keycache_pthread_mutex_lock(&keycache->cache_lock); 00490 00491 #ifdef THREAD 00492 wqueue= &keycache->resize_queue; 00493 thread= my_thread_var; 00494 link_into_queue(wqueue, thread); 00495 00496 while (wqueue->last_thread->next != thread) 00497 { 00498 keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); 00499 } 00500 #endif 00501 00502 keycache->resize_in_flush= 1; 00503 if (flush_all_key_blocks(keycache)) 00504 { 00505 /* TODO: if this happens, we should write a warning in the log file ! */ 00506 keycache->resize_in_flush= 0; 00507 blocks= 0; 00508 keycache->can_be_used= 0; 00509 goto finish; 00510 } 00511 keycache->resize_in_flush= 0; 00512 keycache->can_be_used= 0; 00513 #ifdef THREAD 00514 while (keycache->cnt_for_resize_op) 00515 { 00516 KEYCACHE_DBUG_PRINT("resize_key_cache: wait", 00517 ("suspend thread %ld", thread->id)); 00518 keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); 00519 } 00520 #else 00521 KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0); 00522 #endif 00523 00524 end_key_cache(keycache, 0); /* Don't free mutex */ 00525 /* The following will work even if use_mem is 0 */ 00526 blocks= init_key_cache(keycache, key_cache_block_size, use_mem, 00527 division_limit, age_threshold); 00528 00529 finish: 00530 #ifdef THREAD 00531 unlink_from_queue(wqueue, thread); 00532 /* Signal for the next resize request to proceeed if any */ 00533 if (wqueue->last_thread) 00534 { 00535 KEYCACHE_DBUG_PRINT("resize_key_cache: signal", 00536 ("thread %ld", wqueue->last_thread->next->id)); 00537 keycache_pthread_cond_signal(&wqueue->last_thread->next->suspend); 00538 } 00539 #endif 00540 keycache_pthread_mutex_unlock(&keycache->cache_lock); 00541 DBUG_RETURN(blocks); 00542 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 151 of file mf_keycache.c.
Referenced by examine_log(), handle_segfault(), main(), mi_repair(), mi_sort_records(), multi_key_cache_search(), multi_keycache_init(), myisamchk(), mysql_init_variables(), show_status_array(), start_test(), and sys_var_key_buffer_size::update().
1.4.7

