Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Feb 2011 13:09:22 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218221 - head/sys/x86/x86
Message-ID:  <201102031309.p13D9MfK046347@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Feb  3 13:09:22 2011
New Revision: 218221
URL: http://svn.freebsd.org/changeset/base/218221

Log:
  Use a dedicated taskqueue with a thread that runs at a software-interrupt
  priority for the periodic polling of the machine check registers.

Modified:
  head/sys/x86/x86/mca.c

Modified: head/sys/x86/x86/mca.c
==============================================================================
--- head/sys/x86/x86/mca.c	Thu Feb  3 12:19:07 2011	(r218220)
+++ head/sys/x86/x86/mca.c	Thu Feb  3 13:09:22 2011	(r218221)
@@ -105,6 +105,7 @@ SYSCTL_INT(_hw_mca, OID_AUTO, erratum383
 static STAILQ_HEAD(, mca_internal) mca_records;
 static struct callout mca_timer;
 static int mca_ticks = 3600;	/* Check hourly by default. */
+static struct taskqueue *mca_tq;
 static struct task mca_task;
 static struct mtx mca_lock;
 
@@ -606,7 +607,7 @@ static void
 mca_periodic_scan(void *arg)
 {
 
-	taskqueue_enqueue(taskqueue_thread, &mca_task);
+	taskqueue_enqueue(mca_tq, &mca_task);
 	callout_reset(&mca_timer, mca_ticks * hz, mca_periodic_scan, NULL);
 }
 
@@ -620,7 +621,7 @@ sysctl_mca_scan(SYSCTL_HANDLER_ARGS)
 	if (error)
 		return (error);
 	if (i)
-		taskqueue_enqueue(taskqueue_thread, &mca_task);
+		taskqueue_enqueue(mca_tq, &mca_task);
 	return (0);
 }
 
@@ -631,6 +632,9 @@ mca_startup(void *dummy)
 	if (!mca_enabled || !(cpu_feature & CPUID_MCA))
 		return;
 
+	mca_tq = taskqueue_create("mca", M_WAITOK, taskqueue_thread_enqueue,
+	    &mca_tq);
+	taskqueue_start_threads(&mca_tq, 1, PI_SWI(SWI_TQ), "mca taskq");
 	callout_reset(&mca_timer, mca_ticks * hz, mca_periodic_scan,
 		    NULL);
 }
@@ -670,7 +674,7 @@ mca_setup(uint64_t mcg_cap)
 
 	mtx_init(&mca_lock, "mca", NULL, MTX_SPIN);
 	STAILQ_INIT(&mca_records);
-	TASK_INIT(&mca_task, 0x8000, mca_scan_cpus, NULL);
+	TASK_INIT(&mca_task, 0, mca_scan_cpus, NULL);
 	callout_init(&mca_timer, CALLOUT_MPSAFE);
 	SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO,
 	    "count", CTLFLAG_RD, &mca_count, 0, "Record count");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102031309.p13D9MfK046347>