mariadb/mysys
Satya B cf9966f86f Fix for Bug#37408 - Compressed MyISAM files should not require/use mmap()
When compressed myisam files are opened, they are always memory mapped
sometimes causing memory swapping problems.

When we mmap the myisam compressed tables of size greater than the memory 
available, the kswapd0 process utilization is very high consuming 30-40% of 
the cpu. This happens only with linux kernels older than 2.6.9

With newer linux kernels, we don't have this problem of high cpu consumption
and this option may not be required.
 
The option 'myisam_mmap_size' is added to limit the amount of memory used for
memory mapping of myisam files. This option is not dynamic.

The default value on 32 bit system is 4294967295 bytes and on 64 bit system it
is 18446744073709547520 bytes.

Note: Testcase only tests the option variable. The actual bug has be to 
tested manually.

include/my_global.h:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  define SIZE_T_MAX
include/myisam.h:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  declare 'myisam_mmap_size' and 'myisam_mmap_used' variables and the mutex
  THR_LOCK_myisam_mmap
myisam/mi_packrec.c:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  add 'myisam_mmap_size' option which limits the memory available to mmap of 
  myisam files
myisam/mi_static.c:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  declare 'myisam_mmap_size' and 'myisam_mmap_used' variables and the mutex
  THR_LOCK_myisam_mmap
myisam/myisamdef.h:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  move MEMMAP_EXTRA_MARGIN to myisam.h so that it can be used in mysqld.cc
mysql-test/r/variables.result:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  Testcase for BUG#37408 to test the myisam_mmap_size option
mysql-test/t/variables.test:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  Testcase for BUG#37408 to test the myisam_mmap_size option
mysys/my_thr_init.c:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  intialize the lock THR_LOCK_myisam_mmap
sql/mysqld.cc:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  add the 'myisam_mmap_size' option
sql/set_var.cc:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  add the 'myisam_mmap_size' to the SHOW VARIABLES list
2009-12-17 16:55:50 +05:30
..
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
array.c Bug#43572 Handle failures from hash_init 2009-07-12 11:18:53 +05:30
base64.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-10 17:47:54 -05:00
ChangeLog Fix skipp -> skip once and for all. 2004-06-03 11:52:54 -05:00
charset-def.c Bug#28916 LDML doesn't work for utf8 2007-06-07 17:55:55 +05:00
charset.c Merge mysql.com:/home/svoj/devel/mysql/BUG31159/mysql-4.1-engines 2007-10-24 16:39:13 +05:00
checksum.c Many files: 2006-12-23 20:17:15 +01:00
CMakeLists.txt Bug #20748: Configuration files should not be read more than once 2007-11-07 15:23:50 -07:00
default.c Bug#43461: invalid comparison with string literal in default.c 2009-03-19 17:20:15 -03:00
default_modify.c Many files: 2006-12-23 20:17:15 +01:00
errors.c BUG#22082 Slave hangs(holds mutex) on "disk full" 2009-03-06 17:32:00 +08:00
hash.c Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-09-17 17:10:30 +02:00
list.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
make-ccc Import changeset 2000-07-31 21:29:14 +02:00
make-conf.c Many files: 2006-12-23 20:17:15 +01:00
Makefile.am Bug#17270 - mysql client tool could not find ../share/charsets folder and fails. 2009-07-31 15:22:02 -04:00
md5.c Bug #42434: license of mysys MD5 implementation is not GPL-compatible 2009-03-09 20:57:03 +02:00
mf_arr_appstr.c Bug #20748: Configuration files should not be read more than once 2007-11-07 15:23:50 -07:00
mf_brkhant.c Many files: 2006-12-23 20:17:15 +01:00
mf_cache.c Many files: 2006-12-23 20:17:15 +01:00
mf_dirname.c Many files: 2006-12-23 20:17:15 +01:00
mf_fn_ext.c Many files: 2006-12-23 20:17:15 +01:00
mf_format.c Many files: 2006-12-23 20:17:15 +01:00
mf_getdate.c The get_date() function in mysys interpreted the GETDATE_GMT option 2009-05-07 11:17:07 -07:00
mf_iocache.c Post-merge fix. Observe C declaration placement rules. 2009-09-02 09:02:22 -03:00
mf_iocache2.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-10 17:47:54 -05:00
mf_keycache.c Compile fix for Windows: 2009-10-16 14:06:33 +02:00
mf_keycaches.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
mf_loadpath.c Many files: 2006-12-23 20:17:15 +01:00
mf_pack.c Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-08-28 17:51:31 +02:00
mf_path.c Many files: 2006-12-23 20:17:15 +01:00
mf_qsort.c Fix for bug #31207: Test "join_nested" shows different strategy on IA64 2007-10-17 20:08:58 +04:00
mf_qsort2.c Many files: 2006-12-23 20:17:15 +01:00
mf_radix.c Many files: 2006-12-23 20:17:15 +01:00
mf_same.c Many files: 2006-12-23 20:17:15 +01:00
mf_sort.c Fix for bug #31207: Test "join_nested" shows different strategy on IA64 2007-10-17 20:08:58 +04:00
mf_soundex.c Many files: 2006-12-23 20:17:15 +01:00
mf_strip.c Many files: 2006-12-23 20:17:15 +01:00
mf_tempdir.c Bug#23736 Pointer free error in mysqlbinlog 2007-03-20 10:34:25 -04:00
mf_tempfile.c avoid using GetTempFileName in a way it's documented to not work on windows 2007-09-27 08:56:06 +02:00
mf_unixpath.c Many files: 2006-12-23 20:17:15 +01:00
mf_util.c Many files: 2006-12-23 20:17:15 +01:00
mf_wcomp.c Many files: 2006-12-23 20:17:15 +01:00
mf_wfile.c Many files: 2006-12-23 20:17:15 +01:00
mulalloc.c Many files: 2006-12-23 20:17:15 +01:00
my_access.c Many files: 2006-12-23 20:17:15 +01:00
my_aes.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
my_alarm.c Many files: 2006-12-23 20:17:15 +01:00
my_alloc.c Bug#38296 (low memory crash with many conditions in a query) 2008-08-11 10:10:00 -06:00
my_append.c Many files: 2006-12-23 20:17:15 +01:00
my_bit.c Many files: 2006-12-23 20:17:15 +01:00
my_bitmap.c Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2007-01-22 14:04:40 +02:00
my_chsize.c Many files: 2006-12-23 20:17:15 +01:00
my_clock.c Many files: 2006-12-23 20:17:15 +01:00
my_compress.c Many files: 2006-12-23 20:17:15 +01:00
my_conio.c Bug #29469: Client dies if a query is issued after hitting Ctrl + C 2007-07-10 10:43:12 +03:00
my_copy.c Fix for BUG#46591 - .frm file isn't sync'd with sync_frm enabled for 2009-09-03 16:02:03 +05:30
my_crc32.c Many files: 2006-12-23 20:17:15 +01:00
my_create.c Fix for bug #31781: multi-table UPDATE with temp-pool enabled fails 2008-03-03 17:34:06 +03:00
my_delete.c Many files: 2006-12-23 20:17:15 +01:00
my_div.c Many files: 2006-12-23 20:17:15 +01:00
my_dup.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
my_error.c Fixed bug #20710. 2007-04-29 00:50:33 +05:00
my_file.c Many files: 2006-12-23 20:17:15 +01:00
my_fopen.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
my_fstream.c BUG#22082 Slave hangs(holds mutex) on "disk full" 2009-03-06 17:32:00 +08:00
my_gethostbyname.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
my_gethwaddr.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
my_getopt.c Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-08-28 17:51:31 +02:00
my_getpagesize.c Many files: 2006-12-23 20:17:15 +01:00
my_getsystime.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
my_getwd.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
my_handler.c Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-main 2007-03-28 20:46:42 +03:00
my_init.c Bug#36279 - mysql built with Visual Studio 2005 does not display 2008-11-10 21:18:04 +01:00
my_largepage.c Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms. 2007-08-29 19:20:18 +04:00
my_lib.c Fix for bug #31207: Test "join_nested" shows different strategy on IA64 2007-10-17 20:08:58 +04:00
my_libwrap.c Many files: 2006-12-23 20:17:15 +01:00
my_lock.c Many files: 2006-12-23 20:17:15 +01:00
my_lockmem.c Many files: 2006-12-23 20:17:15 +01:00
my_lread.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
my_lwrite.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
my_malloc.c Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms. 2007-08-29 19:20:18 +04:00
my_memmem.c my_memmem.c: 2007-04-11 01:47:42 +02:00
my_messnc.c Many files: 2006-12-23 20:17:15 +01:00
my_mkdir.c Many files: 2006-12-23 20:17:15 +01:00
my_mmap.c Many files: 2006-12-23 20:17:15 +01:00
my_net.c Many files: 2006-12-23 20:17:15 +01:00
my_netware.c Many files: 2006-12-23 20:17:15 +01:00
my_new.cc Bug#43461: invalid comparison with string literal in default.c 2009-03-19 17:20:15 -03:00
my_once.c Many files: 2006-12-23 20:17:15 +01:00
my_open.c Bug#25222 Win32 HANDLE leak in my_sopen() 2007-03-07 10:46:38 -05:00
my_os2cond.c Many files: 2006-12-23 20:17:15 +01:00
my_os2dirsrch.c Many files: 2006-12-23 20:17:15 +01:00
my_os2dirsrch.h Many files: 2006-12-23 20:17:15 +01:00
my_os2dlfcn.c Many files: 2006-12-23 20:17:15 +01:00
my_os2dlfcn.h0 Many files: 2006-12-23 20:17:15 +01:00
my_os2file64.c Many files: 2006-12-23 20:17:15 +01:00
my_os2mutex.c Fixes for Netware 2003-01-28 08:38:28 +02:00
my_os2thread.c Many files: 2006-12-23 20:17:15 +01:00
my_os2tls.c Many files: 2006-12-23 20:17:15 +01:00
my_port.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
my_pread.c BUG#22082 Slave hangs(holds mutex) on "disk full" 2009-03-06 17:32:00 +08:00
my_pthread.c my_pthread.c: 2007-07-30 20:40:49 +02:00
my_quick.c Many files: 2006-12-23 20:17:15 +01:00
my_read.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
my_realloc.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
my_redel.c merge 2009-09-02 15:33:18 +03:00
my_rename.c Many files: 2006-12-23 20:17:15 +01:00
my_seek.c BUG#27141 - Calling tell(-1) under Windows causes assertion failure in Debug mode 2007-06-05 03:16:02 +05:00
my_sleep.c Many files: 2006-12-23 20:17:15 +01:00
my_static.c Bug#17332 - changing key_buffer_size on a running server 2009-09-07 18:35:37 +02:00
my_static.h revert the push of bug 35616. 2008-05-06 11:57:19 +03:00
my_symlink.c merging fix 2008-08-26 13:32:43 +05:00
my_symlink2.c Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines 2007-11-12 15:16:00 +04:00
my_sync.c Many files: 2006-12-23 20:17:15 +01:00
my_thr_init.c Fix for Bug#37408 - Compressed MyISAM files should not require/use mmap() 2009-12-17 16:55:50 +05:30
my_wincond.c Bug#47768 pthread_cond_timedwait() is broken on windows 2009-10-06 09:38:44 +02:00
my_windac.c Many files: 2006-12-23 20:17:15 +01:00
my_winthread.c Bug#30992 Wrong implementation of pthread_mutex_trylock() 2007-10-03 21:38:32 +02:00
my_write.c BUG#22082 Slave hangs(holds mutex) on "disk full" 2009-03-06 17:32:00 +08:00
mysys_priv.h Many files: 2006-12-23 20:17:15 +01:00
ptr_cmp.c Fixed compiler warnings (for linux and win32 and win64) 2007-02-22 16:59:57 +02:00
queues.c Fix for bug #31207: Test "join_nested" shows different strategy on IA64 2007-10-17 20:08:58 +04:00
raid.cc Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-main 2007-03-28 20:46:42 +03:00
raid2.c Many files: 2006-12-23 20:17:15 +01:00
rijndael.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
safemalloc.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-10 17:47:54 -05:00
sha1.c Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2007-01-22 14:04:40 +02:00
string.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-10 17:47:54 -05:00
test_charset.c Many files: 2006-12-23 20:17:15 +01:00
test_dir.c Many files: 2006-12-23 20:17:15 +01:00
test_fn.c Many files: 2006-12-23 20:17:15 +01:00
test_xml.c Many files: 2006-12-23 20:17:15 +01:00
testhash.c Many files: 2006-12-23 20:17:15 +01:00
thr_alarm.c Avoid compilation problem on AIX. 2008-04-28 13:41:12 -04:00
thr_lock.c Bug#36579 Dumping information about locks in use may lead to a server crash 2008-08-25 10:18:52 -03:00
thr_mutex.c BUG#30992 (Wrong implementation of pthread_mutex_trylock()): 2007-10-01 15:11:15 +02:00
thr_rwlock.c Many files: 2006-12-23 20:17:15 +01:00
tree.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
typelib.c Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-08-28 17:51:31 +02:00