InnoDB Plugin
1.0
Main Page
Data Structures
Files
File List
Globals
include
buf0lru.h
Go to the documentation of this file.
1
/*****************************************************************************
2
3
Copyright (c) 1995, 2013, Oracle and/or its affiliates. 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.,
15
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16
17
*****************************************************************************/
18
19
/**************************************************/
26
#ifndef buf0lru_h
27
#define buf0lru_h
28
29
#include "
univ.i
"
30
#ifndef UNIV_HOTBACKUP
31
#include "
ut0byte.h
"
32
#include "
buf0types.h
"
33
34
// Forward declaration
35
struct
trx_t
;
36
37
/******************************************************************/
42
UNIV_INTERN
43
ibool
44
buf_LRU_buf_pool_running_out
(
void
);
45
/*==============================*/
46
47
/*#######################################################################
48
These are low-level functions
49
#########################################################################*/
50
52
#define BUF_LRU_OLD_MIN_LEN 512
/* 8 megabytes of 16k pages */
53
54
/******************************************************************/
59
UNIV_INTERN
60
void
61
buf_LRU_flush_or_remove_pages
(
62
/*==========================*/
63
ulint
id
,
64
buf_remove_t
buf_remove,
65
const
trx_t
* trx);
68
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
69
/********************************************************************/
71
UNIV_INTERN
72
void
73
buf_LRU_insert_zip_clean
(
74
/*=====================*/
75
buf_page_t
* bpage);
76
#endif
/* UNIV_DEBUG || UNIV_BUF_DEBUG */
77
78
/******************************************************************/
89
UNIV_INTERN
90
bool
91
buf_LRU_free_page
(
92
/*==============*/
93
buf_page_t
* bpage,
94
bool
zip)
96
__attribute__((nonnull));
97
/******************************************************************/
100
UNIV_INTERN
101
ibool
102
buf_LRU_scan_and_free_block
(
103
/*========================*/
104
buf_pool_t
* buf_pool,
105
ibool
scan_all)
108
__attribute__((nonnull,warn_unused_result));
109
/******************************************************************/
113
UNIV_INTERN
114
buf_block_t
*
115
buf_LRU_get_free_only
(
116
/*==================*/
117
buf_pool_t
* buf_pool);
118
/******************************************************************/
144
UNIV_INTERN
145
buf_block_t
*
146
buf_LRU_get_free_block
(
147
/*===================*/
148
buf_pool_t
* buf_pool)
149
__attribute__((nonnull,warn_unused_result));
150
/******************************************************************/
154
UNIV_INTERN
155
ibool
156
buf_LRU_evict_from_unzip_LRU
(
157
/*=========================*/
158
buf_pool_t
* buf_pool);
159
/******************************************************************/
161
UNIV_INTERN
162
void
163
buf_LRU_block_free_non_file_page
(
164
/*=============================*/
165
buf_block_t
*
block
);
166
/******************************************************************/
171
UNIV_INTERN
172
void
173
buf_LRU_add_block
(
174
/*==============*/
175
buf_page_t
* bpage,
176
ibool
old);
180
/******************************************************************/
182
UNIV_INTERN
183
void
184
buf_unzip_LRU_add_block
(
185
/*====================*/
186
buf_block_t
*
block
,
187
ibool
old);
189
/******************************************************************/
191
UNIV_INTERN
192
void
193
buf_LRU_make_block_young
(
194
/*=====================*/
195
buf_page_t
* bpage);
196
/******************************************************************/
198
UNIV_INTERN
199
void
200
buf_LRU_make_block_old
(
201
/*===================*/
202
buf_page_t
* bpage);
203
/**********************************************************************/
206
UNIV_INTERN
207
ulint
208
buf_LRU_old_ratio_update
(
209
/*=====================*/
210
uint old_pct,
212
ibool
adjust);
215
/********************************************************************/
218
UNIV_INTERN
219
void
220
buf_LRU_stat_update
(
void
);
221
/*=====================*/
222
223
/******************************************************************/
225
UNIV_INTERN
226
void
227
buf_LRU_free_one_page
(
228
/*==================*/
229
buf_page_t
* bpage)
232
__attribute__((nonnull));
233
234
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
235
/**********************************************************************/
238
UNIV_INTERN
239
ibool
240
buf_LRU_validate
(
void
);
241
/*==================*/
242
#endif
/* UNIV_DEBUG || UNIV_BUF_DEBUG */
243
#if defined UNIV_DEBUG_PRINT || defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
244
/**********************************************************************/
246
UNIV_INTERN
247
void
248
buf_LRU_print
(
void
);
249
/*===============*/
250
#endif
/* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */
251
254
#define BUF_LRU_OLD_RATIO_DIV 1024
255
258
#define BUF_LRU_OLD_RATIO_MAX BUF_LRU_OLD_RATIO_DIV
259
264
#define BUF_LRU_OLD_RATIO_MIN 51
265
266
#if BUF_LRU_OLD_RATIO_MIN >= BUF_LRU_OLD_RATIO_MAX
267
# error "BUF_LRU_OLD_RATIO_MIN >= BUF_LRU_OLD_RATIO_MAX"
268
#endif
269
#if BUF_LRU_OLD_RATIO_MAX > BUF_LRU_OLD_RATIO_DIV
270
# error "BUF_LRU_OLD_RATIO_MAX > BUF_LRU_OLD_RATIO_DIV"
271
#endif
272
275
extern
uint
buf_LRU_old_threshold_ms
;
276
/* @} */
277
283
struct
buf_LRU_stat_t
284
{
285
ulint
io
;
286
ulint
unzip
;
287
};
288
291
extern
buf_LRU_stat_t
buf_LRU_stat_cur
;
292
295
extern
buf_LRU_stat_t
buf_LRU_stat_sum
;
296
297
/********************************************************************/
299
#define buf_LRU_stat_inc_io() buf_LRU_stat_cur.io++
300
/********************************************************************/
302
#define buf_LRU_stat_inc_unzip() buf_LRU_stat_cur.unzip++
303
304
#ifndef UNIV_NONINL
305
#include "
buf0lru.ic
"
306
#endif
307
308
#endif
/* !UNIV_HOTBACKUP */
309
310
#endif
Generated on Fri Aug 21 2015 19:14:24 for InnoDB Plugin by
1.8.1.2