Commit 1b12a1c4 authored by Sunny Bains's avatar Sunny Bains

Revert the kernel mutex split phase I patch. Some artefacts have been left

in the code but they have nothing to do with the kernel mutex split code.
Some subsequent commits use the new functions. This patch has been tested
with: ./mtr --suite=innodb with UNIV_DEBUG and UNIV_SYNC_DEBUG enabled.
All tests were successful.
parent 42974cbf
......@@ -381,9 +381,6 @@ struct que_thr_struct{
thus far */
ulint lock_state; /*!< lock state of thread (table or
row) */
struct srv_slot_struct*
slot; /* The thread slot in the wait
array in srv_sys_t */
};
#define QUE_THR_MAGIC_N 8476583
......
......@@ -239,6 +239,7 @@ extern ibool srv_print_latch_waits;
# define srv_print_latch_waits FALSE
#endif /* UNIV_DEBUG */
extern ulint srv_activity_count;
extern ulint srv_fatal_semaphore_wait_threshold;
extern ulint srv_dml_needed_delay;
......@@ -313,6 +314,12 @@ typedef struct export_var_struct export_struc;
/** Status variables to be passed to MySQL */
extern export_struc export_vars;
/** The server system */
typedef struct srv_sys_struct srv_sys_t;
/** The server system */
extern srv_sys_t* srv_sys;
# ifdef UNIV_PFS_THREAD
/* Keys to register InnoDB threads with performance schema */
extern mysql_pfs_key_t trx_rollback_clean_thread_key;
......@@ -414,8 +421,6 @@ enum srv_thread_type {
be biggest) */
};
struct srv_slot_struct;
/*********************************************************************//**
Boots Innobase server.
@return DB_SUCCESS or error code */
......@@ -466,6 +471,17 @@ srv_set_io_thread_op_info(
const char* str); /*!< in: constant char string describing the
state */
/*********************************************************************//**
Releases threads of the type given from suspension in the thread table.
NOTE! The server mutex has to be reserved by the caller!
@return number of threads released: this may be less than n if not
enough threads were suspended at the moment */
UNIV_INTERN
ulint
srv_release_threads(
/*================*/
enum srv_thread_type type, /*!< in: thread type */
ulint n); /*!< in: number of threads to release */
/*********************************************************************//**
The master thread controlling the server.
@return a dummy parameter */
UNIV_INTERN
......@@ -612,13 +628,6 @@ void
srv_export_innodb_status(void);
/*==========================*/
/******************************************************************//**
Increment the server activity counter. */
UNIV_INTERN
void
srv_inc_activity_count(void);
/*=========================*/
/*********************************************************************//**
Asynchronous purge thread.
@return a dummy parameter */
......@@ -700,6 +709,20 @@ struct export_var_struct{
ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
};
/** Thread slot in the thread table */
typedef struct srv_slot_struct srv_slot_t;
/** Thread table is an array of slots */
typedef srv_slot_t srv_table_t;
/** The server system struct */
struct srv_sys_struct{
srv_table_t* threads; /*!< server thread table */
UT_LIST_BASE_NODE_T(que_thr_t)
tasks; /*!< task queue */
};
extern ulint srv_n_threads_active[];
#else /* !UNIV_HOTBACKUP */
# define srv_use_adaptive_hash_indexes FALSE
# define srv_use_checksums TRUE
......
......@@ -105,7 +105,6 @@ extern mysql_pfs_key_t rw_lock_mutex_key;
extern mysql_pfs_key_t srv_dict_tmpfile_mutex_key;
extern mysql_pfs_key_t srv_innodb_monitor_mutex_key;
extern mysql_pfs_key_t srv_misc_tmpfile_mutex_key;
extern mysql_pfs_key_t srv_threads_mutex_key;
extern mysql_pfs_key_t srv_monitor_file_mutex_key;
extern mysql_pfs_key_t syn_arr_mutex_key;
# ifdef UNIV_SYNC_DEBUG
......@@ -588,9 +587,6 @@ Kernel mutex If a kernel operation needs a file
| fsp x-latch before acquiring the kernel
| mutex.
V
Threads mutex Thread scheduling mutex
|
V
Search system mutex
|
V
......@@ -661,9 +657,8 @@ or row lock! */
/*------------------------------------- MySQL binlog mutex */
/*-------------------------------*/
#define SYNC_KERNEL 300
#define SYNC_THREADS 299
#define SYNC_REC_LOCK 298
#define SYNC_TRX_LOCK_HEAP 297
#define SYNC_REC_LOCK 299
#define SYNC_TRX_LOCK_HEAP 298
#define SYNC_TRX_SYS_HEADER 290
#define SYNC_LOG 170
#define SYNC_LOG_FLUSH_ORDER 147
......
......@@ -245,6 +245,9 @@ by one. */
#define UNIV_SET_MEM_TO_ZERO
#endif
#define UNIV_DEBUG
#define UNIV_SYNC_DEBUG
/*
#define UNIV_SQL_DEBUG
#define UNIV_LOG_DEBUG
......
......@@ -29,6 +29,7 @@ Created 5/27/1996 Heikki Tuuri
#include "que0que.ic"
#endif
#include "srv0que.h"
#include "usr0sess.h"
#include "trx0trx.h"
#include "trx0roll.h"
......@@ -225,8 +226,6 @@ que_thr_create(
thr->resource = 0;
thr->lock_state = QUE_THR_LOCK_NOLOCK;
thr->slot = NULL;
UT_LIST_ADD_LAST(thrs, parent->thrs, thr);
return(thr);
......@@ -312,9 +311,7 @@ que_thr_end_wait_no_next_thr(
/* In MySQL we let the OS thread (not just the query thread) to wait
for the lock to be released: */
if (thr != NULL) {
srv_release_mysql_thread_if_suspended(thr);
}
srv_release_mysql_thread_if_suspended(thr);
/* srv_que_task_enqueue_low(thr); */
}
......
......@@ -341,7 +341,7 @@ row_undo_step(
ut_ad(thr);
srv_inc_activity_count();
srv_activity_count++;
trx = thr_get_trx(thr);
......
This diff is collapsed.
......@@ -1167,7 +1167,6 @@ sync_thread_add_level(
case SYNC_SEARCH_SYS_CONF:
case SYNC_TRX_LOCK_HEAP:
case SYNC_KERNEL:
case SYNC_THREADS:
case SYNC_IBUF_BITMAP_MUTEX:
case SYNC_RSEG:
case SYNC_TRX_UNDO:
......
......@@ -37,6 +37,7 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rec.h"
#include "que0que.h"
#include "usr0sess.h"
#include "srv0que.h"
#include "srv0start.h"
#include "row0undo.h"
#include "row0mysql.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment