=== modified file 'storage/innobase/buf/buf0buf.cc' --- storage/innobase/buf/buf0buf.cc 2013-08-14 11:34:09 +0000 +++ storage/innobase/buf/buf0buf.cc 2013-11-04 16:50:39 +0000 @@ -1558,6 +1558,8 @@ btr_search_sys_create(buf_pool_get_curr_size() / sizeof(void*) / 64); + buf_flush_event = os_event_create("buf_flush_event"); + return(DB_SUCCESS); } === modified file 'storage/innobase/buf/buf0flu.cc' --- storage/innobase/buf/buf0flu.cc 2013-08-11 10:13:22 +0000 +++ storage/innobase/buf/buf0flu.cc 2013-11-04 17:00:03 +0000 @@ -2305,8 +2305,6 @@ buf_page_cleaner_is_active = TRUE; - buf_flush_event = os_event_create("buf_flush_event"); - while (srv_shutdown_state == SRV_SHUTDOWN_NONE) { /* The page_cleaner skips sleep if the server is === modified file 'storage/innobase/buf/buf0lru.cc' --- storage/innobase/buf/buf0lru.cc 2013-08-14 11:34:09 +0000 +++ storage/innobase/buf/buf0lru.cc 2013-11-04 16:58:26 +0000 @@ -1296,6 +1296,10 @@ TRUE again when we flush a batch from this buffer pool. */ buf_pool->try_LRU_scan = FALSE; + + /* Also tell the page_cleaner thread that + there is work for it to do. */ + os_event_set(buf_flush_event); } } @@ -1339,8 +1343,6 @@ page_cleaner do an LRU batch for us. */ if (n_iterations > 1) { - os_event_set(buf_flush_event); - os_thread_sleep(10000); } === modified file 'storage/innobase/log/log0recv.cc' --- storage/innobase/log/log0recv.cc 2013-08-14 11:34:09 +0000 +++ storage/innobase/log/log0recv.cc 2013-11-04 16:54:43 +0000 @@ -322,7 +322,10 @@ while (srv_shutdown_state == SRV_SHUTDOWN_NONE) { - os_thread_sleep(100000); + /* Wait till we get a signal to clean the LRU list. + Bounded by max wait time of 100ms. */ + ib_int64_t sig_count = os_event_reset(buf_flush_event); + os_event_wait_time_low(buf_flush_event, 100000, sig_count); mutex_enter(&recv_sys->writer_mutex);