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
277b055f
Commit
277b055f
authored
Jul 28, 2010
by
Jimmy Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug #55581 by backporting fix of #52546 from mysql-trunk-innodb
to mysql-5.1-innodb plugin.
parent
6c4335b4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
34 deletions
+43
-34
storage/innodb_plugin/ChangeLog
storage/innodb_plugin/ChangeLog
+6
-0
storage/innodb_plugin/include/mem0pool.h
storage/innodb_plugin/include/mem0pool.h
+0
-12
storage/innodb_plugin/mem/mem0mem.c
storage/innodb_plugin/mem/mem0mem.c
+6
-6
storage/innodb_plugin/mem/mem0pool.c
storage/innodb_plugin/mem/mem0pool.c
+26
-15
storage/innodb_plugin/srv/srv0start.c
storage/innodb_plugin/srv/srv0start.c
+5
-1
No files found.
storage/innodb_plugin/ChangeLog
View file @
277b055f
2010-07-27 The InnoDB Team
* include/mem0pool.h, mem/mem0mem.c, mem/mem0pool.c, srv/srv0start.c:
Fix Bug#55581 shutdown with innodb-use-sys-malloc=0: assert
mutex->magic_n == MUTEX_MAGIC_N.
2010-06-30 The InnoDB Team
2010-06-30 The InnoDB Team
* btr/btr0sea.c, ha/ha0ha.c, handler/ha_innodb.cc, include/btr0sea.h:
* btr/btr0sea.c, ha/ha0ha.c, handler/ha_innodb.cc, include/btr0sea.h:
...
...
storage/innodb_plugin/include/mem0pool.h
View file @
277b055f
...
@@ -100,18 +100,6 @@ mem_pool_get_reserved(
...
@@ -100,18 +100,6 @@ mem_pool_get_reserved(
/*==================*/
/*==================*/
mem_pool_t
*
pool
);
/*!< in: memory pool */
mem_pool_t
*
pool
);
/*!< in: memory pool */
/********************************************************************//**
/********************************************************************//**
Reserves the mem pool mutex. */
UNIV_INTERN
void
mem_pool_mutex_enter
(
void
);
/*======================*/
/********************************************************************//**
Releases the mem pool mutex. */
UNIV_INTERN
void
mem_pool_mutex_exit
(
void
);
/*=====================*/
/********************************************************************//**
Validates a memory pool.
Validates a memory pool.
@return TRUE if ok */
@return TRUE if ok */
UNIV_INTERN
UNIV_INTERN
...
...
storage/innodb_plugin/mem/mem0mem.c
View file @
277b055f
...
@@ -367,7 +367,7 @@ mem_heap_create_block(
...
@@ -367,7 +367,7 @@ mem_heap_create_block(
block
->
line
=
line
;
block
->
line
=
line
;
#ifdef MEM_PERIODIC_CHECK
#ifdef MEM_PERIODIC_CHECK
m
em_pool_mutex_enter
(
);
m
utex_enter
(
&
(
mem_comm_pool
->
mutex
)
);
if
(
!
mem_block_list_inited
)
{
if
(
!
mem_block_list_inited
)
{
mem_block_list_inited
=
TRUE
;
mem_block_list_inited
=
TRUE
;
...
@@ -376,7 +376,7 @@ mem_heap_create_block(
...
@@ -376,7 +376,7 @@ mem_heap_create_block(
UT_LIST_ADD_LAST
(
mem_block_list
,
mem_block_list
,
block
);
UT_LIST_ADD_LAST
(
mem_block_list
,
mem_block_list
,
block
);
m
em_pool_mutex_exit
(
);
m
utex_exit
(
&
(
mem_comm_pool
->
mutex
)
);
#endif
#endif
mem_block_set_len
(
block
,
len
);
mem_block_set_len
(
block
,
len
);
mem_block_set_type
(
block
,
type
);
mem_block_set_type
(
block
,
type
);
...
@@ -479,11 +479,11 @@ mem_heap_block_free(
...
@@ -479,11 +479,11 @@ mem_heap_block_free(
UT_LIST_REMOVE
(
list
,
heap
->
base
,
block
);
UT_LIST_REMOVE
(
list
,
heap
->
base
,
block
);
#ifdef MEM_PERIODIC_CHECK
#ifdef MEM_PERIODIC_CHECK
m
em_pool_mutex_enter
(
);
m
utex_enter
(
&
(
mem_comm_pool
->
mutex
)
);
UT_LIST_REMOVE
(
mem_block_list
,
mem_block_list
,
block
);
UT_LIST_REMOVE
(
mem_block_list
,
mem_block_list
,
block
);
m
em_pool_mutex_exit
(
);
m
utex_exit
(
&
(
mem_comm_pool
->
mutex
)
);
#endif
#endif
ut_ad
(
heap
->
total_size
>=
block
->
len
);
ut_ad
(
heap
->
total_size
>=
block
->
len
);
...
@@ -556,7 +556,7 @@ mem_validate_all_blocks(void)
...
@@ -556,7 +556,7 @@ mem_validate_all_blocks(void)
{
{
mem_block_t
*
block
;
mem_block_t
*
block
;
m
em_pool_mutex_enter
(
);
m
utex_enter
(
&
(
mem_comm_pool
->
mutex
)
);
block
=
UT_LIST_GET_FIRST
(
mem_block_list
);
block
=
UT_LIST_GET_FIRST
(
mem_block_list
);
...
@@ -568,6 +568,6 @@ mem_validate_all_blocks(void)
...
@@ -568,6 +568,6 @@ mem_validate_all_blocks(void)
block
=
UT_LIST_GET_NEXT
(
mem_block_list
,
block
);
block
=
UT_LIST_GET_NEXT
(
mem_block_list
,
block
);
}
}
m
em_pool_mutex_exit
(
);
m
utex_exit
(
&
(
mem_comm_pool
->
mutex
)
);
}
}
#endif
#endif
storage/innodb_plugin/mem/mem0pool.c
View file @
277b055f
...
@@ -34,6 +34,7 @@ Created 5/12/1997 Heikki Tuuri
...
@@ -34,6 +34,7 @@ Created 5/12/1997 Heikki Tuuri
#include "ut0lst.h"
#include "ut0lst.h"
#include "ut0byte.h"
#include "ut0byte.h"
#include "mem0mem.h"
#include "mem0mem.h"
#include "srv0start.h"
/* We would like to use also the buffer frames to allocate memory. This
/* We would like to use also the buffer frames to allocate memory. This
would be desirable, because then the memory consumption of the database
would be desirable, because then the memory consumption of the database
...
@@ -121,23 +122,33 @@ mysql@lists.mysql.com */
...
@@ -121,23 +122,33 @@ mysql@lists.mysql.com */
UNIV_INTERN
ulint
mem_n_threads_inside
=
0
;
UNIV_INTERN
ulint
mem_n_threads_inside
=
0
;
/********************************************************************//**
/********************************************************************//**
Reserves the mem pool mutex. */
Reserves the mem pool mutex if we are not in server shutdown. Use
UNIV_INTERN
this function only in memory free functions, since only memory
free functions are used during server shutdown. */
UNIV_INLINE
void
void
mem_pool_mutex_enter
(
void
)
mem_pool_mutex_enter
(
/*======================*/
/*=================*/
mem_pool_t
*
pool
)
/*!< in: memory pool */
{
{
mutex_enter
(
&
(
mem_comm_pool
->
mutex
));
if
(
srv_shutdown_state
<
SRV_SHUTDOWN_EXIT_THREADS
)
{
mutex_enter
(
&
(
pool
->
mutex
));
}
}
}
/********************************************************************//**
/********************************************************************//**
Releases the mem pool mutex. */
Releases the mem pool mutex if we are not in server shutdown. As
UNIV_INTERN
its corresponding mem_pool_mutex_enter() function, use it only
in memory free functions */
UNIV_INLINE
void
void
mem_pool_mutex_exit
(
void
)
mem_pool_mutex_exit
(
/*=====================*/
/*================*/
mem_pool_t
*
pool
)
/*!< in: memory pool */
{
{
mutex_exit
(
&
(
mem_comm_pool
->
mutex
));
if
(
srv_shutdown_state
<
SRV_SHUTDOWN_EXIT_THREADS
)
{
mutex_exit
(
&
(
pool
->
mutex
));
}
}
}
/********************************************************************//**
/********************************************************************//**
...
@@ -567,7 +578,7 @@ mem_area_free(
...
@@ -567,7 +578,7 @@ mem_area_free(
n
=
ut_2_log
(
size
);
n
=
ut_2_log
(
size
);
m
utex_enter
(
&
(
pool
->
mutex
)
);
m
em_pool_mutex_enter
(
pool
);
mem_n_threads_inside
++
;
mem_n_threads_inside
++
;
ut_a
(
mem_n_threads_inside
==
1
);
ut_a
(
mem_n_threads_inside
==
1
);
...
@@ -595,7 +606,7 @@ mem_area_free(
...
@@ -595,7 +606,7 @@ mem_area_free(
pool
->
reserved
+=
ut_2_exp
(
n
);
pool
->
reserved
+=
ut_2_exp
(
n
);
mem_n_threads_inside
--
;
mem_n_threads_inside
--
;
m
utex_exit
(
&
(
pool
->
mutex
)
);
m
em_pool_mutex_exit
(
pool
);
mem_area_free
(
new_ptr
,
pool
);
mem_area_free
(
new_ptr
,
pool
);
...
@@ -611,7 +622,7 @@ mem_area_free(
...
@@ -611,7 +622,7 @@ mem_area_free(
}
}
mem_n_threads_inside
--
;
mem_n_threads_inside
--
;
m
utex_exit
(
&
(
pool
->
mutex
)
);
m
em_pool_mutex_exit
(
pool
);
ut_ad
(
mem_pool_validate
(
pool
));
ut_ad
(
mem_pool_validate
(
pool
));
}
}
...
@@ -630,7 +641,7 @@ mem_pool_validate(
...
@@ -630,7 +641,7 @@ mem_pool_validate(
ulint
free
;
ulint
free
;
ulint
i
;
ulint
i
;
m
utex_enter
(
&
(
pool
->
mutex
)
);
m
em_pool_mutex_enter
(
pool
);
free
=
0
;
free
=
0
;
...
@@ -658,7 +669,7 @@ mem_pool_validate(
...
@@ -658,7 +669,7 @@ mem_pool_validate(
ut_a
(
free
+
pool
->
reserved
==
pool
->
size
);
ut_a
(
free
+
pool
->
reserved
==
pool
->
size
);
m
utex_exit
(
&
(
pool
->
mutex
)
);
m
em_pool_mutex_exit
(
pool
);
return
(
TRUE
);
return
(
TRUE
);
}
}
...
...
storage/innodb_plugin/srv/srv0start.c
View file @
277b055f
...
@@ -2018,9 +2018,13 @@ innobase_shutdown_for_mysql(void)
...
@@ -2018,9 +2018,13 @@ innobase_shutdown_for_mysql(void)
pars_lexer_close
();
pars_lexer_close
();
log_mem_free
();
log_mem_free
();
buf_pool_free
();
buf_pool_free
();
ut_free_all_mem
();
mem_close
();
mem_close
();
/* ut_free_all_mem() frees all allocated memory not freed yet
in shutdown, and it will also free the ut_list_mutex, so it
should be the last one for all operation */
ut_free_all_mem
();
if
(
os_thread_count
!=
0
if
(
os_thread_count
!=
0
||
os_event_count
!=
0
||
os_event_count
!=
0
||
os_mutex_count
!=
0
||
os_mutex_count
!=
0
...
...
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