Drizzled Public API Documentation

buf0lru.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1995, 2009, Innobase Oy. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #pragma once
27 #ifndef buf0lru_h
28 #define buf0lru_h
29 
30 #include <sys/types.h>
31 #include "univ.i"
32 #include "ut0byte.h"
33 #include "buf0types.h"
34 
45 };
46 
47 /******************************************************************/
55 UNIV_INTERN
56 void
58 /*============================*/
59  buf_pool_t* buf_pool);
60 /******************************************************************/
65 UNIV_INTERN
66 ibool
68 /*==============================*/
69 
70 /*#######################################################################
71 These are low-level functions
72 #########################################################################*/
73 
75 #define BUF_LRU_OLD_MIN_LEN 512 /* 8 megabytes of 16k pages */
76 
78 #define BUF_LRU_FREE_SEARCH_LEN(b) (5 + 2 * BUF_READ_AHEAD_AREA(b))
79 
80 /******************************************************************/
85 UNIV_INTERN
86 void
88 /*==========================*/
89  ulint id);
90 /********************************************************************/
92 UNIV_INTERN
93 void
95 /*=====================*/
96  buf_page_t* bpage);
98 /******************************************************************/
111 UNIV_INTERN
114 /*===============*/
115  buf_page_t* bpage,
116  ibool zip)
118  __attribute__((nonnull));
119 /******************************************************************/
122 UNIV_INTERN
123 ibool
125 /*==========================*/
126  buf_pool_t* buf_pool,
127  ulint n_iterations);
137 /******************************************************************/
141 UNIV_INTERN
144 /*==================*/
145  buf_pool_t* buf_pool);
146 /******************************************************************/
151 UNIV_INTERN
154 /*===================*/
155  buf_pool_t* buf_pool)
156  __attribute__((nonnull,warn_unused_result));
157 
158 /******************************************************************/
160 UNIV_INTERN
161 void
163 /*=============================*/
164  buf_block_t* block);
165 /******************************************************************/
167 UNIV_INTERN
168 void
170 /*==============*/
171  buf_page_t* bpage,
172  ibool old);
176 /******************************************************************/
178 UNIV_INTERN
179 void
181 /*====================*/
182  buf_block_t* block,
183  ibool old);
185 /******************************************************************/
187 UNIV_INTERN
188 void
190 /*=====================*/
191  buf_page_t* bpage);
192 /******************************************************************/
194 UNIV_INTERN
195 void
197 /*===================*/
198  buf_page_t* bpage);
199 /**********************************************************************/
202 UNIV_INTERN
203 ulint
205 /*=====================*/
206  uint old_pct,
208  ibool adjust);
211 /********************************************************************/
214 UNIV_INTERN
215 void
216 buf_LRU_stat_update(void);
217 /*=====================*/
218 
219 /********************************************************************/
221 UNIV_INTERN
222 bool
223 buf_LRU_file_dump(void);
224 /*===================*/
225 
226 /********************************************************************/
228 UNIV_INTERN
229 bool
231 /*======================*/
232 
233 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
234 /**********************************************************************/
237 UNIV_INTERN
238 ibool
239 buf_LRU_validate(void);
240 /*==================*/
241 #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
242 #if defined UNIV_DEBUG_PRINT || defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
243 /**********************************************************************/
245 UNIV_INTERN
246 void
247 buf_LRU_print(void);
248 /*===============*/
249 #endif /* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */
250 
254 extern uint buf_LRU_old_ratio;
256 #define BUF_LRU_OLD_RATIO_DIV 1024
257 
260 #define BUF_LRU_OLD_RATIO_MAX BUF_LRU_OLD_RATIO_DIV
261 
266 #define BUF_LRU_OLD_RATIO_MIN 51
267 
268 #if BUF_LRU_OLD_RATIO_MIN >= BUF_LRU_OLD_RATIO_MAX
269 # error "BUF_LRU_OLD_RATIO_MIN >= BUF_LRU_OLD_RATIO_MAX"
270 #endif
271 #if BUF_LRU_OLD_RATIO_MAX > BUF_LRU_OLD_RATIO_DIV
272 # error "BUF_LRU_OLD_RATIO_MAX > BUF_LRU_OLD_RATIO_DIV"
273 #endif
274 
277 extern uint buf_LRU_old_threshold_ms;
278 /* @} */
279 
286 {
287  ulint io;
288  ulint unzip;
289 };
290 
293 
297 
301 
302 /********************************************************************/
304 #define buf_LRU_stat_inc_io() buf_LRU_stat_cur.io++
305 /********************************************************************/
307 #define buf_LRU_stat_inc_unzip() buf_LRU_stat_cur.unzip++
308 
309 #ifndef UNIV_NONINL
310 #include "buf0lru.ic"
311 #endif
312 
313 #endif
UNIV_INTERN bool buf_LRU_file_restore(void)
Definition: buf0lru.cc:2231
UNIV_INTERN void buf_LRU_make_block_young(buf_page_t *bpage)
Definition: buf0lru.cc:1394
buf_lru_free_block_status
Definition: buf0lru.h:36
uint buf_LRU_old_threshold_ms
Definition: buf0lru.cc:119
UNIV_INTERN void buf_LRU_block_free_non_file_page(buf_block_t *block)
Definition: buf0lru.cc:1676
UNIV_INTERN ibool buf_LRU_search_and_free_block(buf_pool_t *buf_pool, ulint n_iterations)
Definition: buf0lru.cc:711
buf_LRU_stat_t buf_LRU_stat_sum
Definition: buf0lru.cc:112
The buffer pool structure.
Definition: buf0buf.h:1607
UNIV_INTERN enum buf_lru_free_block_status buf_LRU_free_block(buf_page_t *bpage, ibool zip) __attribute__((nonnull))
Definition: buf0lru.cc:1437
UNIV_INTERN void buf_LRU_make_block_old(buf_page_t *bpage)
Definition: buf0lru.cc:1414
UNIV_INTERN void buf_unzip_LRU_add_block(buf_block_t *block, ibool old)
Definition: buf0lru.cc:1234
buf_LRU_stat_t buf_LRU_stat_cur
Definition: buf0lru.cc:108
UNIV_INTERN void buf_LRU_try_free_flushed_blocks(buf_pool_t *buf_pool)
Definition: buf0lru.cc:757
UNIV_INTERN void buf_LRU_add_block(buf_page_t *bpage, ibool old)
Definition: buf0lru.cc:1378
uint buf_LRU_old_ratio
UNIV_INTERN bool buf_LRU_file_dump(void)
Definition: buf0lru.cc:2100
UNIV_INTERN buf_block_t * buf_LRU_get_free_only(buf_pool_t *buf_pool)
Definition: buf0lru.cc:825
UNIV_INTERN void buf_LRU_invalidate_tablespace(ulint id)
Definition: buf0lru.cc:508
UNIV_INTERN ibool buf_LRU_buf_pool_running_out(void)
Definition: buf0lru.cc:792
UNIV_INTERN ulint buf_LRU_old_ratio_update(uint old_pct, ibool adjust)
Definition: buf0lru.cc:2018
Statistics for selecting the LRU list for eviction.
Definition: buf0lru.h:285
UNIV_INTERN void buf_LRU_insert_zip_clean(buf_page_t *bpage)
Definition: buf0lru.cc:533
UNIV_INTERN void buf_LRU_stat_update(void)
Definition: buf0lru.cc:2046
UNIV_INTERN buf_block_t * buf_LRU_get_free_block(buf_pool_t *buf_pool) __attribute__((nonnull