List:Internals« Previous MessageNext Message »
From:Vadim Tkachenko Date:May 27 2005 10:01am
Subject:bk commit into 5.0-hp tree (vtkachenko:1.1875)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0-hp 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.1875 05/05/27 12:00:53 vtkachenko@stripped +14 -0
  Many files:
    undo MMAP patch
  post-commit:
    post trigger changes

  sql/set_var.cc
    1.114 05/05/27 12:00:25 vtkachenko@stripped +0 -3
    undo MMAP patch

  sql/mysqld.cc
    1.459 05/05/27 12:00:25 vtkachenko@stripped +0 -7
    undo MMAP patch

  sql/mysql_priv.h
    1.299 05/05/27 12:00:25 vtkachenko@stripped +1 -1
    undo MMAP patch

  sql/ha_myisam.cc
    1.150 05/05/27 12:00:24 vtkachenko@stripped +0 -4
    undo MMAP patch

  myisam/myisamdef.h
    1.78 05/05/27 12:00:24 vtkachenko@stripped +0 -3
    undo MMAP patch

  myisam/mi_statrec.c
    1.13 05/05/27 12:00:24 vtkachenko@stripped +9 -9
    undo MMAP patch

  myisam/mi_open.c
    1.92 05/05/27 12:00:24 vtkachenko@stripped +0 -3
    undo MMAP patch

  myisam/mi_extra.c
    1.46 05/05/27 12:00:24 vtkachenko@stripped +0 -22
    undo MMAP patch

  myisam/mi_dynrec.c
    1.41 05/05/27 12:00:24 vtkachenko@stripped +7 -38
    undo MMAP patch

  myisam/mi_close.c
    1.20 05/05/27 12:00:24 vtkachenko@stripped +0 -8
    undo MMAP patch

  include/my_sys.h
    1.157 05/05/27 12:00:24 vtkachenko@stripped +0 -6
    undo MMAP patch

  include/my_base.h
    1.71 05/05/27 12:00:23 vtkachenko@stripped +1 -2
    undo MMAP patch

  configure.in
    1.313 05/05/27 12:00:23 vtkachenko@stripped +1 -1
    undo MMAP patch

  BitKeeper/triggers/post-commit
    1.38 05/05/27 12:00:23 vtkachenko@stripped +2 -2
    post trigger changes

# 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:	/users/vtkachenko/bk/HP/mysql-5.0-hp2

--- 1.312/configure.in	2005-05-25 10:17:14 +02:00
+++ 1.313/configure.in	2005-05-27 12:00:23 +02:00
@@ -1920,7 +1920,7 @@
   getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
   getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
   localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
-  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
+  mkstemp mlockall perror poll pread pthread_attr_create mmap getpagesize \
   pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
   pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
   pthread_key_delete pthread_rwlock_rdlock pthread_setprio \

--- 1.70/include/my_base.h	2005-05-25 10:17:15 +02:00
+++ 1.71/include/my_base.h	2005-05-27 12:00:23 +02:00
@@ -152,8 +152,7 @@
     other fields intact. When this is off (by default) InnoDB will use memcpy
     to overwrite entire row.
   */
-  HA_EXTRA_KEYREAD_PRESERVE_FIELDS,
-  HA_EXTRA_MMAP
+  HA_EXTRA_KEYREAD_PRESERVE_FIELDS
 };
 
 	/* The following is parameter to ha_panic() */

--- 1.156/include/my_sys.h	2005-05-25 10:17:15 +02:00
+++ 1.157/include/my_sys.h	2005-05-27 12:00:24 +02:00
@@ -378,7 +378,6 @@
   /* the non-inclusive boundary in the buffer for the currently valid read */
   byte  *read_end;
   byte  *buffer;				/* The read buffer */
-  void  *mmaparea;   /* mmap address */
   /* Used in ASYNC_IO */
   byte  *request_pos;
 
@@ -470,7 +469,6 @@
   /* read_length is the same as buffer_length except when we use async io */
   uint  read_length;
   myf	myflags;			/* Flags used to my_read/my_write */
-  uint  mmap_used;
   /*
     alloced_buffer is 1 if the buffer was allocated by init_io_cache() and
     0 if it was supplied by the user.
@@ -817,10 +815,6 @@
 #endif
 
 #define my_mmap(a,b,c,d,e,f)    mmap(a,b,c,d,e,f)
-#ifdef HAVE_MMAP64
-#undef my_mmap
-#define my_mmap(a,b,c,d,e,f)    mmap64(a,b,c,d,e,f)
-#endif
 #ifdef HAVE_GETPAGESIZE
 #define my_getpagesize()        getpagesize()
 #else

--- 1.19/myisam/mi_close.c	2005-05-25 10:17:15 +02:00
+++ 1.20/myisam/mi_close.c	2005-05-27 12:00:24 +02:00
@@ -81,14 +81,6 @@
       if (my_close(share->kfile,MYF(0)))
         error = my_errno;
     }
-
-    if (share->mmapused == 1)
-    {
-      my_munmap(share->file_map, share->mmaped_length);
-      share->mmapused= 0;
-      share->file_map= NULL;
-    }
-
 #ifdef HAVE_MMAP
     if (share->file_map)
       _mi_unmap_file(info);

--- 1.40/myisam/mi_dynrec.c	2005-05-25 10:17:16 +02:00
+++ 1.41/myisam/mi_dynrec.c	2005-05-27 12:00:24 +02:00
@@ -50,37 +50,6 @@
 
 	/* Interface function from MI_INFO */
 
-uint _mi_read(MI_INFO *info, byte *Buffer, uint Count, my_off_t offset, myf MyFlags)
-{
-  if ((info->opt_flag & MEMMAP_MYISAM_USED) && (info->s->mmaped_length > offset + Count))
-  {
-//    fprintf(stderr, "read with mmap %d\n", info->dfile);
-    memcpy(Buffer, info->s->file_map + offset, Count); 
-    return 0;
-  }
-  else
-  {
-    return my_pread(info->dfile, Buffer, Count, offset, MyFlags);
-  }
-
-}
-
-uint _mi_write(MI_INFO *info, byte *Buffer, uint Count, my_off_t offset, myf MyFlags)
-{
-  if ((info->opt_flag & MEMMAP_MYISAM_USED) && (info->s->mmaped_length > offset + Count))
-  {
-//    fprintf(stderr, "write with mmap %d\n", info->dfile);
-    memcpy(info->s->file_map + offset, Buffer, Count); 
-    return 0;
-  }
-  else
-  {
-    return my_pwrite(info->dfile, Buffer, Count, offset, MyFlags);
-  }
-
-}
-
-
 int _mi_write_dynamic_record(MI_INFO *info, const byte *record)
 {
   ulong reclength=_mi_rec_pack(info,info->rec_buff,record);
@@ -274,7 +243,7 @@
 	  & BLOCK_DELETED))
       DBUG_RETURN(1);				/* Something is wrong */
     mi_sizestore(tmp.header+4,block_info->next_filepos);
-    if (_mi_write(info,(char*) tmp.header+4,8,
+    if (my_pwrite(info->dfile,(char*) tmp.header+4,8,
 		  block_info->prev_filepos+4, MYF(MY_NABP)))
       DBUG_RETURN(1);
     /* Unlink block from next block */
@@ -284,7 +253,7 @@
 	    & BLOCK_DELETED))
 	DBUG_RETURN(1);				/* Something is wrong */
       mi_sizestore(tmp.header+12,block_info->prev_filepos);
-      if (_mi_write(info,(char*) tmp.header+12,8,
+      if (my_pwrite(info->dfile,(char*) tmp.header+12,8,
 		    block_info->next_filepos+12,
 		    MYF(MY_NABP)))
 	DBUG_RETURN(1);
@@ -335,7 +304,7 @@
     {
       char buff[8];
       mi_sizestore(buff,filepos);
-      if (_mi_write(info,buff, 8, delete_block+12, MYF(MY_NABP)))
+      if (my_pwrite(info->dfile,buff, 8, delete_block+12, MYF(MY_NABP)))
 	DBUG_RETURN(1);				/* Error on write */
     }
     else
@@ -393,7 +362,7 @@
       bfill(block_info.header+12,8,255);
     else
       mi_sizestore(block_info.header+12,block_info.next_filepos);
-    if (_mi_write(info,(byte*) block_info.header,20,filepos,
+    if (my_pwrite(info->dfile,(byte*) block_info.header,20,filepos,
 		  MYF(MY_NABP)))
       DBUG_RETURN(1);
     info->s->state.dellink = filepos;
@@ -576,7 +545,7 @@
   else
   {
     info->rec_cache.seek_not_done=1;
-    if (_mi_write(info,(byte*) *record-head_length,length+extra_length+
+    if (my_pwrite(info->dfile,(byte*) *record-head_length,length+extra_length+
 		  del_length,filepos,info->s->write_flag))
       goto err;
   }
@@ -686,7 +655,7 @@
 	      mi_int3store(del_block.header+1, rest_length);
 	      mi_sizestore(del_block.header+4,info->s->state.dellink);
 	      bfill(del_block.header+12,8,255);
-	      if (_mi_write(info,(byte*) del_block.header,20, next_pos,
+	      if (my_pwrite(info->dfile,(byte*) del_block.header,20, next_pos,
 			    MYF(MY_NABP)))
 		DBUG_RETURN(1);
 	      info->s->state.dellink= next_pos;
@@ -1213,7 +1182,7 @@
       }
       if (left_length < block_info.data_len || ! block_info.data_len)
 	goto panic;			/* Wrong linked record */
-      if (_mi_read(info,(byte*) to,block_info.data_len,block_info.filepos,
+      if (my_pread(file,(byte*) to,block_info.data_len,block_info.filepos,
 		   MYF(MY_NABP)))
 	goto panic;
       left_length-=block_info.data_len;

--- 1.45/myisam/mi_extra.c	2005-05-25 10:17:16 +02:00
+++ 1.46/myisam/mi_extra.c	2005-05-27 12:00:24 +02:00
@@ -367,28 +367,6 @@
   case HA_EXTRA_CHANGE_KEY_TO_DUP:
     mi_extra_keyflag(info, function);
     break;
-  case HA_EXTRA_MMAP:
-    if ((share->mmapused == 0) && (share->state.state.data_file_length > 0))
-    {
-      share->file_map=(byte*)
-                      my_mmap(0,
-                              (size_t)(share->state.state.data_file_length + MEMMAP_EXTRA_MARGIN),
-                              PROT_READ|PROT_WRITE, MAP_SHARED | MAP_NORESERVE, info->dfile, 0L);
-      madvise(share->file_map, share->state.state.data_file_length, MADV_RANDOM);
-
-      if (share->file_map == (byte*) MAP_FAILED)
-      {
-        DBUG_PRINT("warning",("mmap failed: errno: %d",errno));
-        error= my_errno= errno;
-        break;
-      }
-      share->mmapused= 1;
-      share->mmaped_length= share->state.state.data_file_length;
-    }
-    if (share->mmapused)
-      info->opt_flag|= MEMMAP_MYISAM_USED;
-
-    break;
   case HA_EXTRA_KEY_CACHE:
   case HA_EXTRA_NO_KEY_CACHE:
   default:

--- 1.91/myisam/mi_open.c	2005-05-25 10:17:16 +02:00
+++ 1.92/myisam/mi_open.c	2005-05-27 12:00:24 +02:00
@@ -193,9 +193,6 @@
     share->state_diff_length=len-MI_STATE_INFO_SIZE;
 
     mi_state_info_read(disk_cache, &share->state);
-    share->mmapused= 0;
-    share->mmaped_length= 0;
-    share->file_map= NULL;
     len= mi_uint2korr(share->state.header.base_info_length);
     if (len != MI_BASE_INFO_SIZE)
     {

--- 1.12/myisam/mi_statrec.c	2005-05-25 10:17:16 +02:00
+++ 1.13/myisam/mi_statrec.c	2005-05-27 12:00:24 +02:00
@@ -28,14 +28,14 @@
   {
     my_off_t filepos=info->s->state.dellink;
     info->rec_cache.seek_not_done=1;		/* We have done a seek */
-    if (_mi_read(info,(char*) &temp[0],info->s->base.rec_reflength,
+    if (my_pread(info->dfile,(char*) &temp[0],info->s->base.rec_reflength,
 		info->s->state.dellink+1,
 		 MYF(MY_NABP)))
       goto err;
     info->s->state.dellink= _mi_rec_pos(info->s,temp);
     info->state->del--;
     info->state->empty-=info->s->base.pack_reclength;
-    if (_mi_write(info, (char*) record, info->s->base.reclength,
+    if (my_pwrite(info->dfile, (char*) record, info->s->base.reclength,
 		  filepos,
 		  MYF(MY_NABP)))
       goto err;
@@ -64,7 +64,7 @@
     else
     {
       info->rec_cache.seek_not_done=1;		/* We have done a seek */
-      if (_mi_write(info,(char*) record,info->s->base.reclength,
+      if (my_pwrite(info->dfile,(char*) record,info->s->base.reclength,
 		    info->state->data_file_length,
 		    info->s->write_flag))
 	goto err;
@@ -72,7 +72,7 @@
       {
 	uint length=info->s->base.pack_reclength - info->s->base.reclength;
 	bzero((char*) temp,length);
-	if (_mi_write(info, (byte*) temp,length,
+	if (my_pwrite(info->dfile, (byte*) temp,length,
 		      info->state->data_file_length+
 		      info->s->base.reclength,
 		      info->s->write_flag))
@@ -90,7 +90,7 @@
 int _mi_update_static_record(MI_INFO *info, my_off_t pos, const byte *record)
 {
   info->rec_cache.seek_not_done=1;		/* We have done a seek */
-  return (_mi_write(info,
+  return (my_pwrite(info->dfile,
 		    (char*) record,info->s->base.reclength,
 		    pos,
 		    MYF(MY_NABP)) != 0);
@@ -107,7 +107,7 @@
   _mi_dpointer(info,temp+1,info->s->state.dellink);
   info->s->state.dellink = info->lastpos;
   info->rec_cache.seek_not_done=1;
-  return (_mi_write(info,(byte*) temp, 1+info->s->rec_reflength,
+  return (my_pwrite(info->dfile,(byte*) temp, 1+info->s->rec_reflength,
 		    info->lastpos, MYF(MY_NABP)) != 0);
 }
 
@@ -131,7 +131,7 @@
   if ((info->opt_flag & READ_CHECK_USED))
   {						/* If check isn't disabled  */
     info->rec_cache.seek_not_done=1;		/* We have done a seek */
-    if (_mi_read(info, (char*) info->rec_buff, info->s->base.reclength,
+    if (my_pread(info->dfile, (char*) info->rec_buff, info->s->base.reclength,
 		 info->lastpos,
 		 MYF(MY_NABP)))
       DBUG_RETURN(-1);
@@ -154,7 +154,7 @@
   DBUG_ENTER("_mi_cmp_static_unique");
 
   info->rec_cache.seek_not_done=1;		/* We have done a seek */
-  if (_mi_read(info, (char*) info->rec_buff, info->s->base.reclength,
+  if (my_pread(info->dfile, (char*) info->rec_buff, info->s->base.reclength,
 	       pos, MYF(MY_NABP)))
     DBUG_RETURN(-1);
   DBUG_RETURN(mi_unique_comp(def, record, info->rec_buff,
@@ -180,7 +180,7 @@
       return(-1);
     info->rec_cache.seek_not_done=1;		/* We have done a seek */
 
-    error=_mi_read(info,(char*) record,info->s->base.reclength,
+    error=my_pread(info->dfile,(char*) record,info->s->base.reclength,
 		   pos,MYF(MY_NABP)) != 0;
     fast_mi_writeinfo(info);
     if (! error)

--- 1.77/myisam/myisamdef.h	2005-05-25 10:17:16 +02:00
+++ 1.78/myisam/myisamdef.h	2005-05-27 12:00:24 +02:00
@@ -206,8 +206,6 @@
   pthread_mutex_t intern_lock;		/* Locking for use with _locking */
   rw_lock_t *key_root_lock;
 #endif
-  uint  mmapused;
-  my_off_t mmaped_length;
 } MYISAM_SHARE;
 
 
@@ -329,7 +327,6 @@
 	/* bits in opt_flag */
 #define MEMMAP_USED	32
 #define REMEMBER_OLD_POS 64
-#define MEMMAP_MYISAM_USED 128
 
 #define WRITEINFO_UPDATE_KEYFILE	1
 #define WRITEINFO_NO_UNLOCK		2

--- 1.149/sql/ha_myisam.cc	2005-05-25 10:17:17 +02:00
+++ 1.150/sql/ha_myisam.cc	2005-05-27 12:00:24 +02:00
@@ -238,10 +238,6 @@
   
   if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE))
     VOID(mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0));
-
-  if (opt_myisam_use_mmap)
-    VOID(mi_extra(file, HA_EXTRA_MMAP, 0));
-
   info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
   if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED))
     VOID(mi_extra(file, HA_EXTRA_WAIT_LOCK, 0));

--- 1.298/sql/mysql_priv.h	2005-05-25 10:17:17 +02:00
+++ 1.299/sql/mysql_priv.h	2005-05-27 12:00:25 +02:00
@@ -1092,7 +1092,7 @@
 extern bool mysql_proc_table_exists;
 extern uint volatile thread_count, thread_running, global_read_lock;
 extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
-extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
+extern my_bool opt_safe_show_db, opt_local_infile;
 extern my_bool opt_slave_compressed_protocol, use_temp_pool;
 extern my_bool opt_readonly, lower_case_file_system;
 extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;

--- 1.458/sql/mysqld.cc	2005-05-25 10:17:17 +02:00
+++ 1.459/sql/mysqld.cc	2005-05-27 12:00:25 +02:00
@@ -328,7 +328,6 @@
 my_bool opt_secure_auth= 0;
 my_bool lower_case_file_system= 0;
 my_bool opt_large_pages= 0;
-my_bool opt_myisam_use_mmap= 0;
 uint    opt_large_page_size= 0;
 my_bool opt_old_style_user_limits= 0, trust_routine_creators= 0;
 /*
@@ -4233,7 +4232,6 @@
   OPT_MAX_ERROR_COUNT, OPT_MULTI_RANGE_COUNT, OPT_MYISAM_DATA_POINTER_SIZE,
   OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
   OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
-  OPT_MYISAM_USE_MMAP,
   OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT,
   OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT,
   OPT_OPEN_FILES_LIMIT,
@@ -5370,11 +5368,6 @@
    (gptr*) &global_system_variables.myisam_sort_buff_size,
    (gptr*) &max_system_variables.myisam_sort_buff_size, 0,
    GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
-  {"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
-   "Use mmap/mmap64 for read/write MyISAM tables.",
-   (gptr*) &opt_myisam_use_mmap,
-   (gptr*) &opt_myisam_use_mmap, 0, GET_BOOL, NO_ARG, 0, 
-    0, 0, 0, 0, 0},
   {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
    "Buffer length for TCP/IP and socket communication.",
    (gptr*) &global_system_variables.net_buffer_length,

--- 1.113/sql/set_var.cc	2005-05-25 10:17:18 +02:00
+++ 1.114/sql/set_var.cc	2005-05-27 12:00:25 +02:00
@@ -272,7 +272,6 @@
 sys_var_thd_ulonglong	sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
 sys_var_thd_ulong       sys_myisam_repair_threads("myisam_repair_threads", &SV::myisam_repair_threads);
 sys_var_thd_ulong	sys_myisam_sort_buffer_size("myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
-sys_var_bool_ptr	sys_myisam_use_mmap("myisam_use_mmap", &opt_myisam_use_mmap);
 sys_var_thd_ulong	sys_net_buffer_length("net_buffer_length",
 					      &SV::net_buffer_length);
 sys_var_thd_ulong	sys_net_read_timeout("net_read_timeout",
@@ -624,7 +623,6 @@
   &sys_myisam_data_pointer_size,
   &sys_myisam_max_sort_file_size,
   &sys_myisam_repair_threads,
-  &sys_myisam_use_mmap,
   &sys_myisam_sort_buffer_size,
   &sys_net_buffer_length,
   &sys_net_read_timeout,
@@ -887,7 +885,6 @@
   {sys_myisam_repair_threads.name, (char*) &sys_myisam_repair_threads,
    SHOW_SYS},
   {sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS},
-  {sys_myisam_use_mmap.name, (char*) &sys_myisam_use_mmap, SHOW_SYS},
 #ifdef __NT__
   {"named_pipe",	      (char*) &opt_enable_named_pipe,       SHOW_MY_BOOL},
 #endif

--- 1.37/BitKeeper/triggers/post-commit	2005-04-05 19:52:01 +02:00
+++ 1.38/BitKeeper/triggers/post-commit	2005-05-27 12:00:23 +02:00
@@ -5,7 +5,7 @@
 INTERNALS=internals@stripped
 DOCS=docs-commit@stripped
 LIMIT=10000
-VERSION="5.0"
+VERSION="5.0-hp"
 
 if [ "$REAL_EMAIL" = "" ]
 then
@@ -33,7 +33,7 @@
 
 if [ "$BUG" = "" ]
 then
-  TO=dev-public@stripped
+  TO=vadim@stripped
   BS=""
   BH=""
 else
Thread
bk commit into 5.0-hp tree (vtkachenko:1.1875)Vadim Tkachenko27 May