Below is the list of changes that have just been committed into a local
5.1 repository of vtkachenko. When vtkachenko does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2158 06/02/22 08:32:58 vtkachenko@stripped +3 -0
myisamdef.h, mi_locking.c, mi_dynrec.c:
Fix insert performance with mmap
storage/myisam/myisamdef.h
1.85 06/02/22 08:32:40 vtkachenko@stripped +3 -0
Fix insert performance with mmap
storage/myisam/mi_locking.c
1.45 06/02/22 08:32:27 vtkachenko@stripped +3 -1
Fix insert performance with mmap
storage/myisam/mi_dynrec.c
1.42 06/02/22 08:31:55 vtkachenko@stripped +1 -0
Fix insert performance with mmap
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: vtkachenko
# Host: quadxeon.mysql.com
# Root: /benchmarks/ext3/BUILDS/mysql-5.1-mmap1
--- 1.41/storage/myisam/mi_dynrec.c 2005-12-01 13:34:09 +01:00
+++ 1.42/storage/myisam/mi_dynrec.c 2006-02-22 08:31:55 +01:00
@@ -201,6 +201,7 @@
}
else
{
+ info->s->nonmmaped_inserts++;
if (info->s->concurrent_insert)
rw_unlock(&info->s->mmap_lock);
return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags);
--- 1.44/storage/myisam/mi_locking.c 2006-02-12 20:33:15 +01:00
+++ 1.45/storage/myisam/mi_locking.c 2006-02-22 08:32:27 +01:00
@@ -85,11 +85,13 @@
if (share->changed && !share->w_locks)
{
#ifdef HAVE_MMAP
- if (info->s->mmaped_length != info->s->state.state.data_file_length)
+ if ((info->s->mmaped_length != info->s->state.state.data_file_length) &&
+ (info->s->nonmmaped_inserts > MAX_NONMAPPED_INSERTS))
{
if (info->s->concurrent_insert)
rw_wrlock(&info->s->mmap_lock);
mi_remap_file(info, info->s->state.state.data_file_length);
+ info->s->nonmmaped_inserts= 0;
if (info->s->concurrent_insert)
rw_unlock(&info->s->mmap_lock);
}
--- 1.84/storage/myisam/myisamdef.h 2005-12-28 13:05:20 +01:00
+++ 1.85/storage/myisam/myisamdef.h 2006-02-22 08:32:40 +01:00
@@ -152,6 +152,7 @@
uchar version;
} MI_PACK;
+#define MAX_NONMAPPED_INSERTS 1000
typedef struct st_mi_isam_share { /* Shared between opens */
MI_STATE_INFO state;
@@ -211,6 +212,8 @@
rw_lock_t *key_root_lock;
#endif
my_off_t mmaped_length;
+ uint nonmmaped_inserts; /* counter of writing in non-mmaped
+ area */
rw_lock_t mmap_lock;
} MYISAM_SHARE;
| Thread |
|---|
| • bk commit into 5.1 tree (vtkachenko:1.2158) | Vadim Tkachenko | 22 Feb |