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
96afd28f
Commit
96afd28f
authored
Jan 07, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #131 Don't hold the pair's mutex while running partial eviction.
parent
dddda9d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
ft/cachetable-internal.h
ft/cachetable-internal.h
+1
-1
ft/cachetable.cc
ft/cachetable.cc
+9
-12
No files found.
ft/cachetable-internal.h
View file @
96afd28f
...
...
@@ -525,7 +525,7 @@ public:
uint64_t
reserve_memory
(
double
fraction
,
uint64_t
upper_bound
);
void
release_reserved_memory
(
uint64_t
reserved_memory
);
void
run_eviction_thread
();
void
do_partial_eviction
(
PAIR
p
,
bool
pair_mutex_held
);
void
do_partial_eviction
(
PAIR
p
);
void
evict_pair
(
PAIR
p
,
bool
checkpoint_pending
);
void
wait_for_cache_pressure_to_subside
();
void
signal_eviction_thread
();
...
...
ft/cachetable.cc
View file @
96afd28f
...
...
@@ -807,7 +807,7 @@ static void cachetable_evicter(void* extra) {
static
void
cachetable_partial_eviction
(
void
*
extra
)
{
PAIR
p
=
(
PAIR
)
extra
;
CACHEFILE
cf
=
p
->
cachefile
;
p
->
ev
->
do_partial_eviction
(
p
,
false
);
p
->
ev
->
do_partial_eviction
(
p
);
bjm_remove_background_job
(
cf
->
bjm
);
}
...
...
@@ -4102,10 +4102,10 @@ bool evictor::run_eviction_on_pair(PAIR curr_in_clock) {
write_extraargs
);
if
(
cost
==
PE_CHEAP
)
{
pair_unlock
(
curr_in_clock
);
curr_in_clock
->
size_evicting_estimate
=
0
;
this
->
do_partial_eviction
(
curr_in_clock
,
true
);
this
->
do_partial_eviction
(
curr_in_clock
);
bjm_remove_background_job
(
cf
->
bjm
);
pair_unlock
(
curr_in_clock
);
}
else
if
(
cost
==
PE_EXPENSIVE
)
{
// only bother running an expensive partial eviction
...
...
@@ -4145,25 +4145,22 @@ exit:
}
//
// on entry and exit, pair's mutex is
held if pair_mutex_held is true
// on entry and exit, pair's mutex is
not held
// on exit, PAIR is unpinned
//
void
evictor
::
do_partial_eviction
(
PAIR
p
,
bool
pair_mutex_held
)
{
void
evictor
::
do_partial_eviction
(
PAIR
p
)
{
PAIR_ATTR
new_attr
;
PAIR_ATTR
old_attr
=
p
->
attr
;
p
->
pe_callback
(
p
->
value_data
,
old_attr
,
&
new_attr
,
p
->
write_extraargs
);
this
->
change_pair_attr
(
old_attr
,
new_attr
);
p
->
attr
=
new_attr
;
this
->
decrease_size_evicting
(
p
->
size_evicting_estimate
);
if
(
!
pair_mutex_held
)
{
pair_lock
(
p
);
}
pair_lock
(
p
);
p
->
value_rwlock
.
write_unlock
();
if
(
!
pair_mutex_held
)
{
pair_unlock
(
p
);
}
pair_unlock
(
p
);
}
//
...
...
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