Below is the list of changes that have just been committed into a local
6.0 repository of cpowers. When cpowers 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@stripped, 2008-01-03 23:44:16-06:00, cpowers@stripped +3 -0
Bug#33538 "Falcon memory parameters on 32bit system can be set > 4GB"
- Changed the maximum for falcon_record_memory_max from 0xFFFFFFFFFFFFFFFF to the
maximum addressable memory, i.e. 4GB for 32-bit systems, etc.
storage/falcon/Configuration.cpp@stripped, 2008-01-03 23:44:14-06:00, cpowers@stripped
+8 -3
Configuration::setRecordMemoryMax() now limits falcon_record_memory_max to the maximum
addressable memory rather than physical memory.
storage/falcon/Configuration.h@stripped, 2008-01-03 23:44:14-06:00, cpowers@stripped +1
-0
Added Configuration::maxMemoryAddress
storage/falcon/ha_falcon.cpp@stripped, 2008-01-03 23:44:14-06:00, cpowers@stripped +25
-19
- Compute maximum memory addressable by the current system.
- Set the max value for falcon_record_memory_max to the maximum addressable memory.
diff -Nrup a/storage/falcon/Configuration.cpp b/storage/falcon/Configuration.cpp
--- a/storage/falcon/Configuration.cpp 2007-12-20 15:41:33 -06:00
+++ b/storage/falcon/Configuration.cpp 2008-01-03 23:44:14 -06:00
@@ -55,6 +55,8 @@
#undef PARAMETER_UINT
#undef PARAMETER_BOOL
+extern uint64 max_memory_address;
+
extern uint64 falcon_record_memory_max;
extern uint64 falcon_initial_allocation;
extern uint falcon_allocation_extent;
@@ -73,6 +75,10 @@ extern char* falcon_serial_log_dir;
#undef PARAMETER_UINT
#undef PARAMETER_BOOL
+// Determine the largest memory address, assume 64-bits max
+
+static const ulonglong MSB = ULL(1) << ((sizeof(void *)*8 - 1) & 63));
+static ulonglong max_memory_address = MSB | (MSB - 1);
#endif
#ifdef _DEBUG
@@ -160,6 +166,7 @@ Configuration::Configuration(const char
maxTransactionBacklog = MAX_TRANSACTION_BACKLOG;
#endif
+ maxMemoryAddress = max_memory_address;
javaInitialAllocation = 0;
javaSecondaryAllocation = 0;
maxThreads = 0;
@@ -424,10 +431,8 @@ void Configuration::setRecordScavengeFlo
void Configuration::setRecordMemoryMax(uint64 value)
{
- uint64 totalMemory = getPhysicalMemory();
-
recordMemoryMax = MAX(value, MIN_RECORD_MEMORY);
- recordMemoryMax = MIN(value, totalMemory);
+ recordMemoryMax = MIN(value, maxMemoryAddress);
setRecordScavengeThreshold(recordScavengeThresholdPct);
diff -Nrup a/storage/falcon/Configuration.h b/storage/falcon/Configuration.h
--- a/storage/falcon/Configuration.h 2007-11-07 10:11:19 -06:00
+++ b/storage/falcon/Configuration.h 2008-01-03 23:44:14 -06:00
@@ -64,6 +64,7 @@ public:
short serialLogBlockSize;
bool schedulerEnabled;
bool useDeferredIndexHash;
+ uint64 maxMemoryAddress;
};
#endif // !defined(AFX_CONFIGURATION_H__FE192389_82EE_4E37_BA07_19A71BCFF487__INCLUDED_)
diff -Nrup a/storage/falcon/ha_falcon.cpp b/storage/falcon/ha_falcon.cpp
--- a/storage/falcon/ha_falcon.cpp 2007-12-27 23:58:27 -06:00
+++ b/storage/falcon/ha_falcon.cpp 2008-01-03 23:44:14 -06:00
@@ -70,23 +70,29 @@ static StorageHandler *storageHandler;
#undef PARAMETER_UINT
#undef PARAMETER_BOOL
-unsigned long long falcon_record_memory_max;
-unsigned long long falcon_initial_allocation;
-uint falcon_allocation_extent;
-unsigned long long falcon_page_cache_size;
-char* falcon_serial_log_dir;
-char* falcon_checkpoint_schedule;
-char* falcon_scavenge_schedule;
-//uint falcon_debug_mask;
-//uint falcon_debug_trace;
-FILE *falcon_log_file;
-
-int isolation_levels[4] = {TRANSACTION_READ_UNCOMMITTED,
- TRANSACTION_READ_COMMITTED,
- TRANSACTION_CONSISTENT_READ, // TRANSACTION_WRITE_COMMITTED,
// This is repeatable read
- TRANSACTION_SERIALIZABLE};
+ulonglong falcon_record_memory_max;
+ulonglong falcon_initial_allocation;
+uint falcon_allocation_extent;
+ulonglong falcon_page_cache_size;
+char* falcon_serial_log_dir;
+char* falcon_checkpoint_schedule;
+char* falcon_scavenge_schedule;
+//uint falcon_debug_mask;
+//uint falcon_debug_trace;
+FILE *falcon_log_file;
+
+// Determine the largest memory address, assume 64-bits max
+
+static const ulonglong MSB = ULL(1) << ((sizeof(void *)*8 - 1) & 63);
+ulonglong max_memory_address = MSB | (MSB - 1);
+
+
+int isolation_levels[4] = {TRANSACTION_READ_UNCOMMITTED,
+ TRANSACTION_READ_COMMITTED,
+ TRANSACTION_CONSISTENT_READ, // TRANSACTION_WRITE_COMMITTED, //
This is repeatable read
+ TRANSACTION_SERIALIZABLE};
-static const ulonglong default_table_flags = ( HA_REC_NOT_IN_SEQ
+static const ulonglong default_table_flags = ( HA_REC_NOT_IN_SEQ
| HA_NULL_IN_KEY
| HA_PARTIAL_COLUMN_READ
| HA_CAN_GEOMETRY
@@ -94,7 +100,7 @@ static const ulonglong default_table_fla
| HA_BINLOG_ROW_CAPABLE);
-static struct st_mysql_show_var falconStatus[]=
+static struct st_mysql_show_var falconStatus[] =
{
//{"static", (char*)"just a static text", SHOW_CHAR},
//{"called", (char*)&number_of_calls, SHOW_LONG},
@@ -3011,7 +3017,7 @@ void StorageInterface::updateConsistentR
void StorageInterface::updateRecordMemoryMax(MYSQL_THD thd, struct st_mysql_sys_var*
variable, void* var_ptr, void* save)
{
- falcon_record_memory_max = *(unsigned long long*) save;
+ falcon_record_memory_max = *(ulonglong*) save;
if (storageHandler)
storageHandler->setRecordMemoryMax(falcon_record_memory_max);
@@ -3093,7 +3099,7 @@ static MYSQL_SYSVAR_STR(scavenge_schedul
static MYSQL_SYSVAR_ULONGLONG(record_memory_max, falcon_record_memory_max,
PLUGIN_VAR_RQCMDARG, // | PLUGIN_VAR_READONLY,
"The maximum size of the record memory cache.",
- NULL, StorageInterface::updateRecordMemoryMax, LL(250)<<20, 0, (ulonglong) ~0,
LL(1)<<20);
+ NULL, StorageInterface::updateRecordMemoryMax, LL(250)<<20, 0, (ulonglong)
max_memory_address, LL(1)<<20);
static MYSQL_SYSVAR_ULONGLONG(initial_allocation, falcon_initial_allocation,
PLUGIN_VAR_RQCMDARG, // | PLUGIN_VAR_READONLY,
| Thread |
|---|
| • bk commit into 6.0 tree (cpowers:1.2770) BUG#33538 | cpowers | 4 Jan |