Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
ff4ca605
Commit
ff4ca605
authored
14 years ago
by
Yuriy Vostrikov
Browse files
Options
Downloads
Patches
Plain Diff
[box] Use vector io only if tuple is big enough.
parent
d468b041
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mod/silverbox/box.c
+25
-4
25 additions, 4 deletions
mod/silverbox/box.c
with
25 additions
and
4 deletions
mod/silverbox/box.c
+
25
−
4
View file @
ff4ca605
...
...
@@ -62,6 +62,21 @@ const struct field ASTERISK = {
/* hooks */
typedef
int
(
*
box_hook_t
)
(
struct
box_txn
*
txn
);
/*
For tuples of size below this threshold, when sending a tuple
to the client, make a deep copy of the tuple for the duration
of sending rather than increment a reference counter.
This is necessary to avoid excessive page splits when taking
a snapshot: many small tuples can be accessed by clients
immediately after the snapshot process has forked off,
thus incrementing tuple ref count, and causing the OS to
create a copy of the memory page for the forked
child.
*/
const
int
BOX_REF_THRESHOLD
=
8196
;
struct
namespace
namespace
[
256
];
struct
box_snap_row
{
...
...
@@ -887,12 +902,18 @@ prepare_update_fields(struct box_txn *txn, struct tbuf *data)
static
void
tuple_add_iov
(
struct
box_txn
*
txn
,
struct
box_tuple
*
tuple
)
{
tuple_txn_ref
(
txn
,
tup
le
)
;
size_t
le
n
;
add_iov
(
&
tuple
->
bsize
,
tuple
->
bsize
+
len
=
tuple
->
bsize
+
field_sizeof
(
struct
box_tuple
,
bsize
)
+
field_sizeof
(
struct
box_tuple
,
cardinality
));
field_sizeof
(
struct
box_tuple
,
cardinality
);
if
(
len
>
BOX_REF_THRESHOLD
)
{
tuple_txn_ref
(
txn
,
tuple
);
add_iov
(
&
tuple
->
bsize
,
len
);
}
else
{
add_iov_dup
(
&
tuple
->
bsize
,
len
);
}
}
static
int
__noinline__
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment