Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2387a1ca
Commit
2387a1ca
authored
Jan 12, 2009
by
Vadim Tkachenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync with extensions rev29
parent
d0de4999
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
25 deletions
+99
-25
buf/buf0buf.c
buf/buf0buf.c
+5
-11
buf/buf0flu.c
buf/buf0flu.c
+6
-0
handler/ha_innodb.cc
handler/ha_innodb.cc
+58
-4
ibuf/ibuf0ibuf.c
ibuf/ibuf0ibuf.c
+6
-2
include/srv0srv.h
include/srv0srv.h
+4
-0
srv/srv0srv.c
srv/srv0srv.c
+20
-8
No files found.
buf/buf0buf.c
View file @
2387a1ca
...
...
@@ -1860,7 +1860,6 @@ buf_page_get_gen(
mtr_t
*
mtr
)
/* in: mini-transaction */
{
buf_block_t
*
block
;
buf_page_t
*
bpage
=
NULL
;
ibool
accessed
;
ulint
fix_type
;
ibool
must_read
;
...
...
@@ -1883,9 +1882,7 @@ loop:
//buf_pool_mutex_enter();
if
(
block
)
{
bpage
=
&
block
->
page
;
block_mutex
=
buf_page_get_mutex
(
bpage
);
block_mutex
=
buf_page_get_mutex
((
buf_page_t
*
)
block
);
mutex_enter
(
block_mutex
);
/* If the guess is a compressed page descriptor that
...
...
@@ -1914,8 +1911,7 @@ loop:
mutex_enter
(
&
page_hash_mutex
);
block
=
(
buf_block_t
*
)
buf_page_hash_get
(
space
,
offset
);
if
(
block
)
{
bpage
=
&
block
->
page
;
block_mutex
=
buf_page_get_mutex
(
bpage
);
block_mutex
=
buf_page_get_mutex
((
buf_page_t
*
)
block
);
mutex_enter
(
block_mutex
);
}
mutex_exit
(
&
page_hash_mutex
);
...
...
@@ -1984,12 +1980,11 @@ wait_until_unfixed:
block
=
buf_LRU_get_free_block
(
0
);
ut_a
(
block
);
bpage
=
&
block
->
page
;
block_mutex
=
buf_page_get_mutex
(
bpage
);
block_mutex
=
buf_page_get_mutex
((
buf_page_t
*
)
block
);
//buf_pool_mutex_enter();
mutex_enter
(
&
flush_list_mutex
);
mutex_enter
(
&
LRU_list_mutex
);
mutex_enter
(
&
flush_list_mutex
);
mutex_enter
(
&
page_hash_mutex
);
mutex_enter
(
block_mutex
);
...
...
@@ -2006,8 +2001,7 @@ wait_until_unfixed:
mutex_exit
(
block_mutex
);
block
=
(
buf_block_t
*
)
hash_bpage
;
bpage
=
&
block
->
page
;
block_mutex
=
buf_page_get_mutex
(
bpage
);
block_mutex
=
buf_page_get_mutex
((
buf_page_t
*
)
block
);
mutex_enter
(
block_mutex
);
mutex_exit
(
&
page_hash_mutex
);
...
...
buf/buf0flu.c
View file @
2387a1ca
...
...
@@ -1131,9 +1131,15 @@ flush_next:
old_page_count
=
page_count
;
if
(
srv_flush_neighbor_pages
)
{
/* Try to flush also all the neighbors */
page_count
+=
buf_flush_try_neighbors
(
space
,
offset
,
flush_type
);
}
else
{
/* Try to flush the page only */
page_count
+=
buf_flush_try_page
(
space
,
offset
,
flush_type
);
}
/* fprintf(stderr,
"Flush type %lu, page no %lu, neighb %lu\n",
flush_type, offset,
...
...
handler/ha_innodb.cc
View file @
2387a1ca
...
...
@@ -2073,6 +2073,8 @@ innobase_init(
srv_n_read_io_threads
=
(
ulint
)
innobase_read_io_threads
;
srv_n_write_io_threads
=
(
ulint
)
innobase_write_io_threads
;
srv_read_ahead
&=
3
;
srv_force_recovery
=
(
ulint
)
innobase_force_recovery
;
srv_use_doublewrite_buf
=
(
ibool
)
innobase_use_doublewrite
;
...
...
@@ -9586,14 +9588,62 @@ static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
"Number of IO operations per second the server can do. Tunes background IO rate."
,
NULL
,
NULL
,
100
,
100
,
999999999
,
0
);
static
MYSQL_SYSVAR_ULONG
(
read_ahead
,
srv_read_ahead
,
static
MYSQL_SYSVAR_LONGLONG
(
ibuf_max_size
,
srv_ibuf_max_size
,
PLUGIN_VAR_RQCMDARG
|
PLUGIN_VAR_READONLY
,
"The maximum size of the insert buffer. (in bytes)"
,
NULL
,
NULL
,
LONGLONG_MAX
,
0
,
LONGLONG_MAX
,
0
);
static
MYSQL_SYSVAR_ULONG
(
ibuf_active_contract
,
srv_ibuf_active_contract
,
PLUGIN_VAR_RQCMDARG
,
"Enable/Disable active_contract of insert buffer. 0:disable 1:enable"
,
NULL
,
NULL
,
0
,
0
,
1
,
0
);
static
MYSQL_SYSVAR_ULONG
(
ibuf_accel_rate
,
srv_ibuf_accel_rate
,
PLUGIN_VAR_RQCMDARG
,
"Tunes amount of insert buffer processing of background, in addition to innodb_io_capacity. (in percentage)"
,
NULL
,
NULL
,
100
,
100
,
999999999
,
0
);
static
MYSQL_SYSVAR_ULONG
(
flush_neighbor_pages
,
srv_flush_neighbor_pages
,
PLUGIN_VAR_RQCMDARG
,
"Enable/Disable flushing also neighbor pages. 0:disable 1:enable"
,
NULL
,
NULL
,
1
,
0
,
1
,
0
);
static
void
innodb_read_ahead_update
(
THD
*
thd
,
struct
st_mysql_sys_var
*
var
,
void
*
var_ptr
,
const
void
*
save
)
{
*
(
long
*
)
var_ptr
=
(
*
(
long
*
)
save
)
&
3
;
}
const
char
*
read_ahead_names
[]
=
{
"none"
,
/* 0 */
"random"
,
"linear"
,
"both"
,
/* 3 */
/* For compatibility of the older patch */
"0"
,
/* 4 ("none" + 4) */
"1"
,
"2"
,
"3"
,
/* 7 ("both" + 4) */
NullS
};
TYPELIB
read_ahead_typelib
=
{
array_elements
(
read_ahead_names
)
-
1
,
"read_ahead_typelib"
,
read_ahead_names
,
NULL
};
static
MYSQL_SYSVAR_ENUM
(
read_ahead
,
srv_read_ahead
,
PLUGIN_VAR_RQCMDARG
,
"
Enable/Diasable read aheads bit0:random bit1:linear
"
,
NULL
,
NULL
,
3
,
0
,
3
,
0
);
"
Control read ahead activity. (none, random, linear, [both])
"
,
NULL
,
innodb_read_ahead_update
,
3
,
&
read_ahead_typelib
);
static
MYSQL_SYSVAR_ULONG
(
adaptive_checkpoint
,
srv_adaptive_checkpoint
,
PLUGIN_VAR_RQCMDARG
,
"Enable/Disable flushing along modified age 0:disable 1:enable"
,
"Enable/Disable flushing along modified age
.
0:disable 1:enable"
,
NULL
,
NULL
,
0
,
0
,
1
,
0
);
static
MYSQL_SYSVAR_ULONG
(
read_io_threads
,
innobase_read_io_threads
,
...
...
@@ -9656,6 +9706,10 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR
(
show_locks_held
),
MYSQL_SYSVAR
(
version
),
MYSQL_SYSVAR
(
io_capacity
),
MYSQL_SYSVAR
(
ibuf_max_size
),
MYSQL_SYSVAR
(
ibuf_active_contract
),
MYSQL_SYSVAR
(
ibuf_accel_rate
),
MYSQL_SYSVAR
(
flush_neighbor_pages
),
MYSQL_SYSVAR
(
read_ahead
),
MYSQL_SYSVAR
(
adaptive_checkpoint
),
MYSQL_SYSVAR
(
read_io_threads
),
...
...
ibuf/ibuf0ibuf.c
View file @
2387a1ca
...
...
@@ -382,8 +382,10 @@ ibuf_init_at_db_start(void)
grow in size, as the references on the upper levels of the tree can
change */
ibuf
->
max_size
=
buf_pool_get_curr_size
()
/
UNIV_PAGE_SIZE
/
IBUF_POOL_SIZE_PER_MAX_SIZE
;
ibuf
->
max_size
=
ut_min
(
buf_pool_get_curr_size
()
/
UNIV_PAGE_SIZE
/
IBUF_POOL_SIZE_PER_MAX_SIZE
,
(
ulint
)
srv_ibuf_max_size
/
UNIV_PAGE_SIZE
);
srv_ibuf_max_size
=
(
long
long
)
ibuf
->
max_size
*
UNIV_PAGE_SIZE
;
UT_LIST_INIT
(
ibuf
->
data_list
);
...
...
@@ -2351,11 +2353,13 @@ ibuf_contract_after_insert(
mutex_enter
(
&
ibuf_mutex
);
if
(
!
srv_ibuf_active_contract
)
{
if
(
ibuf
->
size
<
ibuf
->
max_size
+
IBUF_CONTRACT_ON_INSERT_NON_SYNC
)
{
mutex_exit
(
&
ibuf_mutex
);
return
;
}
}
sync
=
FALSE
;
...
...
include/srv0srv.h
View file @
2387a1ca
...
...
@@ -153,6 +153,10 @@ extern ulong srv_max_purge_lag;
extern
ulong
srv_replication_delay
;
extern
ulint
srv_io_capacity
;
extern
long
long
srv_ibuf_max_size
;
extern
ulint
srv_ibuf_active_contract
;
extern
ulint
srv_ibuf_accel_rate
;
extern
ulint
srv_flush_neighbor_pages
;
extern
ulint
srv_read_ahead
;
extern
ulint
srv_adaptive_checkpoint
;
...
...
srv/srv0srv.c
View file @
2387a1ca
...
...
@@ -153,8 +153,8 @@ UNIV_INTERN ulint srv_mem_pool_size = ULINT_MAX;
UNIV_INTERN
ulint
srv_lock_table_size
=
ULINT_MAX
;
UNIV_INTERN
ulint
srv_n_file_io_threads
=
ULINT_MAX
;
ulint
srv_n_read_io_threads
=
1
;
ulint
srv_n_write_io_threads
=
1
;
UNIV_INTERN
ulint
srv_n_read_io_threads
=
1
;
UNIV_INTERN
ulint
srv_n_write_io_threads
=
1
;
#ifdef UNIV_LOG_ARCHIVE
UNIV_INTERN
ibool
srv_log_archive_on
=
FALSE
;
...
...
@@ -319,15 +319,22 @@ UNIV_INTERN int srv_query_thread_priority = 0;
UNIV_INTERN
ulong
srv_replication_delay
=
0
;
ulint
srv_io_capacity
=
100
;
UNIV_INTERN
ulint
srv_io_capacity
=
100
;
/* Returns the number of IO operations that is X percent of the capacity.
PCT_IO(5) -> returns the number of IO operations that is 5% of the max
where max is srv_io_capacity. */
#define PCT_IO(pct) ((ulint) (srv_io_capacity * ((double) pct / 100.0)))
ulint
srv_read_ahead
=
3
;
/* 1: random 2: linear 3: Both */
ulint
srv_adaptive_checkpoint
=
0
;
/* 0:disable 1:enable */
UNIV_INTERN
long
long
srv_ibuf_max_size
=
0
;
UNIV_INTERN
ulint
srv_ibuf_active_contract
=
0
;
/* 0:disable 1:enable */
UNIV_INTERN
ulint
srv_ibuf_accel_rate
=
100
;
#define PCT_IBUF_IO(pct) ((ulint) (srv_io_capacity * srv_ibuf_accel_rate * ((double) pct / 10000.0)))
UNIV_INTERN
ulint
srv_flush_neighbor_pages
=
1
;
/* 0:disable 1:enable */
UNIV_INTERN
ulint
srv_read_ahead
=
3
;
/* 1: random 2: linear 3: Both */
UNIV_INTERN
ulint
srv_adaptive_checkpoint
=
0
;
/* 0:disable 1:enable */
/*-------------------------------------------*/
UNIV_INTERN
ulong
srv_n_spin_wait_rounds
=
20
;
UNIV_INTERN
ulong
srv_n_free_tickets_to_enter
=
500
;
...
...
@@ -2395,7 +2402,7 @@ loop:
if
(
n_pend_ios
<
3
&&
(
n_ios
-
n_ios_old
<
PCT_IO
(
5
)))
{
srv_main_thread_op_info
=
"doing insert buffer merge"
;
ibuf_contract_for_n_pages
(
TRUE
,
PCT_IO
((
srv_insert_buffer_batch_size
/
4
)));
TRUE
,
PCT_I
BUF_I
O
((
srv_insert_buffer_batch_size
/
4
)));
srv_main_thread_op_info
=
"flushing log"
;
...
...
@@ -2431,6 +2438,11 @@ loop:
}
else
{
if
((
log_sys
->
lsn
-
oldest_lsn
)
>
(
log_sys
->
max_checkpoint_age
)
-
((
log_sys
->
max_checkpoint_age
)
/
8
))
{
/* LOG_POOL_PREFLUSH_RATIO_ASYNC is exceeded. */
/* We should not flush from here. */
mutex_exit
(
&
(
log_sys
->
mutex
));
}
else
if
((
log_sys
->
lsn
-
oldest_lsn
)
>
(
log_sys
->
max_checkpoint_age
)
-
((
log_sys
->
max_checkpoint_age
)
/
4
))
{
/* 2nd defence line (max_checkpoint_age * 3/4) */
...
...
@@ -2494,7 +2506,7 @@ loop:
even if the server were active */
srv_main_thread_op_info
=
"doing insert buffer merge"
;
ibuf_contract_for_n_pages
(
TRUE
,
PCT_IO
((
srv_insert_buffer_batch_size
/
4
)));
ibuf_contract_for_n_pages
(
TRUE
,
PCT_I
BUF_I
O
((
srv_insert_buffer_batch_size
/
4
)));
srv_main_thread_op_info
=
"flushing log"
;
log_buffer_flush_to_disk
();
...
...
@@ -2629,7 +2641,7 @@ background_loop:
n_bytes_merged
=
0
;
}
else
{
n_bytes_merged
=
ibuf_contract_for_n_pages
(
TRUE
,
PCT_IO
((
srv_insert_buffer_batch_size
*
5
)));
TRUE
,
PCT_I
BUF_I
O
((
srv_insert_buffer_batch_size
*
5
)));
}
srv_main_thread_op_info
=
"reserving kernel mutex"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment