List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:October 15 2008 10:56pm
Subject:bzr push into mysql-6.0 branch (davi:2876 to 2877) Bug#12702 Bug#35164
Bug#37536
View as plain text  
 2877 Davi Arnaut	2008-10-15
      Bug#35164: Large number of invalid pthread_attr_setschedparam calls
      Bug#37536: Thread scheduling causes performance degradation at low thread count
      Bug#12702: Long queries take 100% of CPU and freeze other applications under Windows
      
      The problem is that although having threads with different priorities
      yields marginal improvements [1] in some platforms [2], relying on some
      statically defined priorities (QUERY_PRIOR and WAIT_PRIOR) to play well
      (or to work at all) with different scheduling practices and disciplines
      is, at best, a shot in the dark as the meaning of priority values may
      change depending on the scheduling policy set for the process.
      
      Another problem is that increasing priorities can hurt other concurrent
      (running on the same hardware) applications (such as AMP) by causing
      starvation problems as MySQL threads will successively preempt lower
      priority processes. This can be evidenced by Bug#12702.
      
      The solution is to not change the threads priorities and rely on the
      system scheduler to perform its job. This also enables a system admin
      to increase or decrease the scheduling priority of the MySQL process,
      if intended.
      
      Furthermore, the internal wrappers and code for changing the priority
      of threads is being removed as they are now unused and ancient.
      
      1. Due to unintentional side effects. On Solaris this could artificially
         help benchmarks as calling the priority changing syscall millions of
         times is more beneficial than the actual setting of the priority.
      
      2. Where it actually works. It has never worked on Linux as the default
         scheduling policy SCHED_OTHER only accepts the static priority 0.
modified:
  configure.in
  include/config-netware.h
  include/my_pthread.h
  mysys/my_pthread.c
  mysys/thr_alarm.c
  sql/mysql_priv.h
  sql/mysqld.cc
  sql/slave.cc
  sql/slave.h
  sql/sql_parse.cc
  sql/sql_prepare.cc
  sql/unireg.h
  storage/innobase/handler/ha_innodb.cc
  storage/innobase/include/srv0srv.h
  storage/innobase/os/os0thread.c
  storage/innobase/srv/srv0srv.c

 2876 Horst Hunger	2008-10-15 [merge]
      Merge of parent tree before push.
modified:
  sql/sql_insert.cc

=== modified file 'configure.in'
--- a/configure.in	2008-10-13 10:44:56 +0000
+++ b/configure.in	2008-10-15 22:53:18 +0000
@@ -2078,11 +2078,9 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bs
   localtime_r gethrtime gmtime_r \
   locking longjmp lrand48 madvise mallinfo memcpy memmove \
   mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 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 \
-  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
-  realpath rename rint rwlock_init setupterm \
+  pthread_attr_getstacksize pthread_attr_setstacksize pthread_condattr_create \
+  pthread_getsequence_np pthread_key_delete pthread_rwlock_rdlock pthread_sigmask \
+  readlink realpath rename rint rwlock_init setupterm \
   shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
   sighold sigset sigthreadmask port_create sleep thr_yield \
   snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \

=== modified file 'include/config-netware.h'
--- a/include/config-netware.h	2007-07-23 21:54:55 +0000
+++ b/include/config-netware.h	2008-10-15 22:53:18 +0000
@@ -73,7 +73,6 @@ extern "C" {
 #undef HAVE_FINITE
 #undef HAVE_GETPWNAM
 #undef HAVE_GETPWUID
-#undef HAVE_PTHREAD_SETSCHEDPARAM
 #undef HAVE_READLINK
 #undef HAVE_STPCPY
 /* changes  end  */

=== modified file 'include/my_pthread.h'
--- a/include/my_pthread.h	2008-09-03 06:07:52 +0000
+++ b/include/my_pthread.h	2008-10-15 22:53:18 +0000
@@ -35,7 +35,6 @@ typedef HANDLE		 pthread_t;
 typedef struct thread_attr {
     DWORD dwStackSize ;
     DWORD dwCreatingFlag ;
-    int priority ;
 } pthread_attr_t ;
 
 typedef struct { int dummy; } pthread_condattr_t;
@@ -112,7 +111,6 @@ int pthread_cond_broadcast(pthread_cond_
 int pthread_cond_destroy(pthread_cond_t *cond);
 int pthread_attr_init(pthread_attr_t *connect_att);
 int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack);
-int pthread_attr_setprio(pthread_attr_t *connect_att,int priority);
 int pthread_attr_destroy(pthread_attr_t *connect_att);
 struct tm *localtime_r(const time_t *timep,struct tm *tmp);
 struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
@@ -160,21 +158,18 @@ void pthread_exit(void *a);	 /* was #def
 #define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A))
 #define pthread_mutex_unlock(A)  (LeaveCriticalSection(A),0)
 #define pthread_mutex_destroy(A) DeleteCriticalSection(A)
-#define my_pthread_setprio(A,B)  SetThreadPriority(GetCurrentThread(), (B))
 #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
 
 #define pthread_join(A,B) (WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0)
 
 /* Dummy defines for easier code */
 #define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
-#define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B)
 #define pthread_attr_setscope(A,B)
 #define pthread_detach_this_thread()
 #define pthread_condattr_init(A)
 #define pthread_condattr_destroy(A)
 #define pthread_yield() Sleep(0) /* according to MSDN */
 
-#define my_pthread_getprio(thread_id) pthread_dummy(0)
 /* per the platform's documentation */
 #define pthread_yield() Sleep(0)
 
@@ -204,8 +199,6 @@ void my_pthread_exit(void *status);
 #define pthread_exit(A) my_pthread_exit(A)
 #endif
 
-extern int my_pthread_getprio(pthread_t thread_id);
-
 #define pthread_key(T,V) pthread_key_t V
 #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
 #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
@@ -277,24 +270,6 @@ int sigwait(sigset_t *setp, int *sigp);	
 #define my_sigset(A,B) signal((A),(B))
 #endif
 
-#ifndef my_pthread_setprio
-#if defined(HAVE_PTHREAD_SETPRIO_NP)		/* FSU threads */
-#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B))
-#elif defined(HAVE_PTHREAD_SETPRIO)
-#define my_pthread_setprio(A,B) pthread_setprio((A),(B))
-#else
-extern void my_pthread_setprio(pthread_t thread_id,int prior);
-#endif
-#endif
-
-#ifndef my_pthread_attr_setprio
-#ifdef HAVE_PTHREAD_ATTR_SETPRIO
-#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B))
-#else
-extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority);
-#endif
-#endif
-
 #if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS)
 #define pthread_attr_setscope(A,B)
 #undef	HAVE_GETHOSTBYADDR_R			/* No definition */

=== modified file 'mysys/my_pthread.c'
--- a/mysys/my_pthread.c	2008-04-09 00:56:49 +0000
+++ b/mysys/my_pthread.c	2008-10-15 22:53:18 +0000
@@ -31,46 +31,6 @@
 
 uint thd_lib_detected= 0;
 
-#ifndef my_pthread_setprio
-void my_pthread_setprio(pthread_t thread_id,int prior)
-{
-#ifdef HAVE_PTHREAD_SETSCHEDPARAM
-  struct sched_param tmp_sched_param;
-  bzero((char*) &tmp_sched_param,sizeof(tmp_sched_param));
-  tmp_sched_param.sched_priority=prior;
-  pthread_setschedparam(thread_id,SCHED_POLICY,&tmp_sched_param);
-#endif
-}
-#endif
-
-#ifndef my_pthread_getprio
-int my_pthread_getprio(pthread_t thread_id)
-{
-#ifdef HAVE_PTHREAD_SETSCHEDPARAM
-  struct sched_param tmp_sched_param;
-  int policy;
-  if (!pthread_getschedparam(thread_id,&policy,&tmp_sched_param))
-  {
-    return tmp_sched_param.sched_priority;
-  }
-#endif
-  return -1;
-}
-#endif
-
-#ifndef my_pthread_attr_setprio
-void my_pthread_attr_setprio(pthread_attr_t *attr, int priority)
-{
-#ifdef HAVE_PTHREAD_SETSCHEDPARAM
-  struct sched_param tmp_sched_param;
-  bzero((char*) &tmp_sched_param,sizeof(tmp_sched_param));
-  tmp_sched_param.sched_priority=priority;
-  pthread_attr_setschedparam(attr,&tmp_sched_param);
-#endif
-}
-#endif
-
-
 /* To allow use of pthread_getspecific with two arguments */
 
 #ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC
@@ -364,7 +324,6 @@ int sigwait(sigset_t *setp, int *sigp)
     pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
     pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
     pthread_attr_setstacksize(&thr_attr,8196);
-    my_pthread_attr_setprio(&thr_attr,100);	/* Very high priority */
     pthread_create(&sigwait_thread_id,&thr_attr,sigwait_thread,setp);
     pthread_attr_destroy(&thr_attr);
   }

=== modified file 'mysys/thr_alarm.c'
--- a/mysys/thr_alarm.c	2008-05-29 15:44:11 +0000
+++ b/mysys/thr_alarm.c	2008-10-15 22:53:18 +0000
@@ -97,8 +97,6 @@ void init_thr_alarm(uint max_alarms)
     pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
     pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
     pthread_attr_setstacksize(&thr_attr,8196);
-
-    my_pthread_attr_setprio(&thr_attr,100);	/* Very high priority */
     pthread_create(&alarm_thread,&thr_attr,alarm_handler,NULL);
     pthread_attr_destroy(&thr_attr);
   }

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2008-10-13 10:38:56 +0000
+++ b/sql/mysql_priv.h	2008-10-15 22:53:18 +0000
@@ -425,17 +425,7 @@ enum open_table_mode
 #if defined(__WIN__)
 #undef	FLUSH_TIME
 #define FLUSH_TIME	1800			/**< Flush every half hour */
-
-#define INTERRUPT_PRIOR -2
-#define CONNECT_PRIOR	-1
-#define WAIT_PRIOR	0
-#define QUERY_PRIOR	2
-#else
-#define INTERRUPT_PRIOR 10
-#define CONNECT_PRIOR	9
-#define WAIT_PRIOR	8
-#define QUERY_PRIOR	6
-#endif /* __WIN92__ */
+#endif /* __WIN__ */
 
 	/* Bits from testflag */
 #define TEST_PRINT_CACHED_TABLES 1

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2008-10-13 10:44:56 +0000
+++ b/sql/mysqld.cc	2008-10-15 22:53:18 +0000
@@ -48,10 +48,6 @@
 #endif
 #endif
 
-#ifndef DEFAULT_SKIP_THREAD_PRIORITY
-#define DEFAULT_SKIP_THREAD_PRIORITY 0
-#endif
-
 #include <thr_alarm.h>
 #include <ft_global.h>
 #include <errmsg.h>
@@ -2777,8 +2773,6 @@ static void start_signal_handler(void)
 #if !defined(HAVE_DEC_3_2_THREADS)
   pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
   (void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
-  if (!(opt_specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_attr_setprio(&thr_attr,INTERRUPT_PRIOR);
 #if defined(__ia64__) || defined(__ia64)
   /*
     Peculiar things with ia64 platforms - it seems we only have half the
@@ -2898,8 +2892,6 @@ pthread_handler_t signal_hand(void *arg 
 	abort_loop=1;				// mark abort for threads
 #ifdef USE_ONE_SIGNAL_HAND
 	pthread_t tmp;
-	if (!(opt_specialflag & SPECIAL_NO_PRIOR))
-	  my_pthread_attr_setprio(&connection_attrib,INTERRUPT_PRIOR);
 	if (pthread_create(&tmp,&connection_attrib, kill_server_thread,
 			   (void*) &sig))
 	  sql_print_error("Can't create thread to kill server");
@@ -3775,8 +3767,6 @@ static int init_thread_environment()
   (void) pthread_attr_setdetachstate(&connection_attrib,
 				     PTHREAD_CREATE_DETACHED);
   pthread_attr_setscope(&connection_attrib, PTHREAD_SCOPE_SYSTEM);
-  if (!(opt_specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_attr_setprio(&connection_attrib,WAIT_PRIOR);
 
   if (pthread_key_create(&THR_THD,NULL) ||
       pthread_key_create(&THR_MALLOC,NULL))
@@ -4501,8 +4491,6 @@ int main(int argc, char **argv)
     unireg_abort(1);				// Will do exit
 
   init_signals();
-  if (!(opt_specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_setprio(pthread_self(),CONNECT_PRIOR);
 #if defined(__ia64__) || defined(__ia64)
   /*
     Peculiar things with ia64 platforms - it seems we only have half the
@@ -5159,8 +5147,6 @@ pthread_handler_t handle_connections_soc
 
   LINT_INIT(new_sock);
 
-  (void) my_pthread_getprio(pthread_self());		// For debugging
-
   FD_ZERO(&clientFDs);
   if (ip_sock != INVALID_SOCKET)
   {
@@ -5363,7 +5349,6 @@ pthread_handler_t handle_connections_nam
   THD *thd;
   my_thread_init();
   DBUG_ENTER("handle_connections_namedpipes");
-  (void) my_pthread_getprio(pthread_self());		// For debugging
 
   DBUG_PRINT("general",("Waiting for named pipe connections."));
   while (!abort_loop)
@@ -6569,8 +6554,9 @@ Can't be set to 1 if --log-slave-updates
   {"skip-symlink", OPT_SKIP_SYMLINKS, "Don't allow symlinking of tables. Deprecated option.  Use --skip-symbolic-links instead.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"skip-thread-priority", OPT_SKIP_PRIOR,
-   "Don't give threads different priorities. Deprecated option.", 0, 0, 0, GET_NO_ARG, NO_ARG,
-   DEFAULT_SKIP_THREAD_PRIORITY, 0, 0, 0, 0, 0},
+   "Deprecated option: Don't give threads different priorities. "
+   "This option has no effect as the implied behavior is already the default.",
+   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_REPLICATION
   {"slave-load-tmpdir", OPT_SLAVE_LOAD_TMPDIR,
    "The location where the slave should put its temporary files when \
@@ -7979,9 +7965,6 @@ static void mysql_init_variables(void)
 #ifdef HAVE_SMEM
   shared_memory_base_name= default_shared_memory_base_name;
 #endif
-#if !defined(my_pthread_setprio) && !defined(HAVE_PTHREAD_SETSCHEDPARAM)
-  opt_specialflag |= SPECIAL_NO_PRIOR;
-#endif
 
 #if defined(__WIN__) || defined(__NETWARE__)
   /* Allow Win32 and NetWare users to move MySQL anywhere */
@@ -8295,8 +8278,8 @@ mysqld_get_one_option(int optid,
   case (int) OPT_SKIP_PRIOR:
     opt_specialflag|= SPECIAL_NO_PRIOR;
     sql_print_warning("The --skip-thread-priority startup option is deprecated "
-                      "and will be removed in MySQL 7.0. MySQL 6.0 and up do not "
-                      "give threads different priorities.");
+                      "and will be removed in MySQL 7.0. This option has no effect "
+                      "as the implied behavior is already the default.");
     break;
   case (int) OPT_SKIP_LOCK:
     opt_external_locking=0;

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2008-09-26 14:05:38 +0000
+++ b/sql/slave.cc	2008-10-15 22:53:18 +0000
@@ -454,8 +454,7 @@ int start_slave_thread(pthread_handler h
                        pthread_cond_t *start_cond,
                        volatile uint *slave_running,
                        volatile ulong *slave_run_id,
-                       Master_info* mi,
-                       bool high_priority)
+                       Master_info* mi)
 {
   pthread_t th;
   ulong start_id;
@@ -485,8 +484,6 @@ int start_slave_thread(pthread_handler h
   }
   start_id= *slave_run_id;
   DBUG_PRINT("info",("Creating new slave thread"));
-  if (high_priority)
-    my_pthread_attr_setprio(&connection_attrib,CONNECT_PRIOR);
   if (pthread_create(&th, &connection_attrib, h_func, (void*)mi))
   {
     if (start_lock)
@@ -549,13 +546,13 @@ int start_slave_threads(bool need_slave_
     error=start_slave_thread(handle_slave_io,lock_io,lock_cond_io,
                              cond_io,
                              &mi->slave_running, &mi->slave_run_id,
-                             mi, 1); //high priority, to read the most possible
+                             mi);
   if (!error && (thread_mask & SLAVE_SQL))
   {
     error=start_slave_thread(handle_slave_sql,lock_sql,lock_cond_sql,
                              cond_sql,
                              &mi->rli.slave_running, &mi->rli.slave_run_id,
-                             mi, 0);
+                             mi);
     if (error)
       terminate_slave_threads(mi, thread_mask & SLAVE_IO, 0);
   }

=== modified file 'sql/slave.h'
--- a/sql/slave.h	2008-07-21 03:55:09 +0000
+++ b/sql/slave.h	2008-10-15 22:53:18 +0000
@@ -162,8 +162,7 @@ int start_slave_thread(pthread_handler h
 		       pthread_cond_t* start_cond,
 		       volatile uint *slave_running,
 		       volatile ulong *slave_run_id,
-		       Master_info* mi,
-                       bool high_priority);
+		       Master_info* mi);
 
 /* If fd is -1, dump to NET */
 int mysql_table_dump(THD* thd, const char* db,

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2008-10-13 10:44:56 +0000
+++ b/sql/sql_parse.cc	2008-10-15 22:53:18 +0000
@@ -996,9 +996,6 @@ bool dispatch_command(enum enum_server_c
     thd->profiling.set_query_source(thd->query, thd->query_length);
 #endif
 
-    if (!(specialflag & SPECIAL_NO_PRIOR))
-      my_pthread_setprio(pthread_self(),QUERY_PRIOR);
-
     mysql_parse(thd, thd->query, thd->query_length, &end_of_stmt);
 
     while (!thd->killed && (end_of_stmt != NULL) && ! thd->is_error())
@@ -1046,8 +1043,6 @@ bool dispatch_command(enum enum_server_c
       mysql_parse(thd, beginning_of_next_stmt, length, &end_of_stmt);
     }
 
-    if (!(specialflag & SPECIAL_NO_PRIOR))
-      my_pthread_setprio(pthread_self(),WAIT_PRIOR);
     DBUG_PRINT("info",("query ready"));
     break;
   }

=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc	2008-08-07 17:52:43 +0000
+++ b/sql/sql_prepare.cc	2008-10-15 22:53:18 +0000
@@ -2064,7 +2064,6 @@ static bool init_param_array(Prepared_st
 void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
 {
   Prepared_statement *stmt;
-  bool error;
   DBUG_ENTER("mysql_stmt_prepare");
 
   DBUG_PRINT("prep_query", ("%s", packet));
@@ -2087,15 +2086,7 @@ void mysql_stmt_prepare(THD *thd, const 
   sp_cache_flush_obsolete(&thd->sp_proc_cache);
   sp_cache_flush_obsolete(&thd->sp_func_cache);
 
-  if (!(specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_setprio(pthread_self(),QUERY_PRIOR);
-
-  error= stmt->prepare(packet, packet_length);
-
-  if (!(specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_setprio(pthread_self(),WAIT_PRIOR);
-
-  if (error)
+  if (stmt->prepare(packet, packet_length))
   {
     /* Statement map deletes statement on erase */
     thd->stmt_map.erase(stmt);
@@ -2556,14 +2547,8 @@ void mysql_stmt_fetch(THD *thd, char *pa
   thd->stmt_arena= stmt;
   thd->set_n_backup_statement(stmt, &stmt_backup);
 
-  if (!(specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_setprio(pthread_self(), QUERY_PRIOR);
-
   cursor->fetch(num_rows);
 
-  if (!(specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_setprio(pthread_self(), WAIT_PRIOR);
-
   if (!cursor->is_open())
   {
     stmt->close_cursor();
@@ -3238,14 +3223,8 @@ reexecute:
     thd->m_reprepare_observer = &reprepare_observer;
   }
 
-  if (!(specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_setprio(pthread_self(),QUERY_PRIOR);
-
   error= execute(expanded_query, open_cursor) || thd->is_error();
 
-  if (!(specialflag & SPECIAL_NO_PRIOR))
-    my_pthread_setprio(pthread_self(), WAIT_PRIOR);
-
   thd->m_reprepare_observer= NULL;
 
   if (error && !thd->is_fatal_error && !thd->killed &&

=== modified file 'sql/unireg.h'
--- a/sql/unireg.h	2008-08-26 12:00:01 +0000
+++ b/sql/unireg.h	2008-10-15 22:53:18 +0000
@@ -122,7 +122,7 @@
 #define SPECIAL_SAME_DB_NAME   16		/* form name = file name */
 #define SPECIAL_ENGLISH        32		/* English error messages */
 #define SPECIAL_NO_RESOLVE     64		/* Don't use gethostname */
-#define SPECIAL_NO_PRIOR	128		/* Don't prioritize threads */
+#define SPECIAL_NO_PRIOR	128		/* Obsolete */
 #define SPECIAL_BIG_SELECTS	256		/* Don't use heap tables */
 #define SPECIAL_NO_HOST_CACHE	512		/* Don't cache hosts */
 #define SPECIAL_SHORT_LOG_FORMAT 1024

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2008-10-01 12:02:28 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2008-10-15 22:53:18 +0000
@@ -1531,13 +1531,6 @@ innobase_init(
 
 	ut_a(default_path);
 
-	if (specialflag & SPECIAL_NO_PRIOR) {
-		srv_set_thread_priorities = FALSE;
-	} else {
-		srv_set_thread_priorities = TRUE;
-		srv_query_thread_priority = QUERY_PRIOR;
-	}
-
 	/* Set InnoDB initialization parameters according to the values
 	read from MySQL .cnf file */
 

=== modified file 'storage/innobase/include/srv0srv.h'
--- a/storage/innobase/include/srv0srv.h	2008-08-21 23:38:19 +0000
+++ b/storage/innobase/include/srv0srv.h	2008-10-15 22:53:18 +0000
@@ -129,9 +129,6 @@ extern ibool	srv_stats_on_metadata;
 extern ibool	srv_use_doublewrite_buf;
 extern ibool	srv_use_checksums;
 
-extern ibool	srv_set_thread_priorities;
-extern int	srv_query_thread_priority;
-
 extern ulong	srv_max_buf_pool_modified_pct;
 extern ulong	srv_max_purge_lag;
 extern ibool	srv_use_awe;

=== modified file 'storage/innobase/os/os0thread.c'
--- a/storage/innobase/os/os0thread.c	2006-09-21 07:39:09 +0000
+++ b/storage/innobase/os/os0thread.c	2008-10-15 22:53:18 +0000
@@ -113,15 +113,6 @@ os_thread_create(
 			      0,	/* thread runs immediately */
 			      &win_thread_id);
 
-	if (srv_set_thread_priorities) {
-
-		/* Set created thread priority the same as a normal query
-		in MYSQL: we try to prevent starvation of threads by
-		assigning same priority QUERY_PRIOR to all */
-
-		ut_a(SetThreadPriority(thread, srv_query_thread_priority));
-	}
-
 	if (thread_id) {
 		*thread_id = win_thread_id;
 	}
@@ -180,11 +171,6 @@ os_thread_create(
 #if !(defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10))
 	pthread_attr_destroy(&attr);
 #endif
-	if (srv_set_thread_priorities) {
-
-		my_pthread_setprio(pthread, srv_query_thread_priority);
-	}
-
 	if (thread_id) {
 		*thread_id = pthread;
 	}

=== modified file 'storage/innobase/srv/srv0srv.c'
--- a/storage/innobase/srv/srv0srv.c	2008-08-21 23:38:19 +0000
+++ b/storage/innobase/srv/srv0srv.c	2008-10-15 22:53:18 +0000
@@ -333,9 +333,6 @@ ibool	srv_stats_on_metadata	= TRUE;
 ibool	srv_use_doublewrite_buf	= TRUE;
 ibool	srv_use_checksums = TRUE;
 
-ibool	srv_set_thread_priorities = TRUE;
-int	srv_query_thread_priority = 0;
-
 /* TRUE if the Address Windowing Extensions of Windows are used; then we must
 disable adaptive hash indexes */
 ibool	srv_use_awe			= FALSE;

Thread
bzr push into mysql-6.0 branch (davi:2876 to 2877) Bug#12702 Bug#35164Bug#37536Davi Arnaut16 Oct