diff options
author | jhb <jhb@FreeBSD.org> | 2011-02-03 13:09:22 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-02-03 13:09:22 +0000 |
commit | 5cec5b65a536337095eaeb2b594afe03910f4db5 (patch) | |
tree | 0aae13caafb96cafa65081102d6a6ac0d9c97402 /sys/x86 | |
parent | 4d632ac7a73ec1c318e0c2aeca0d01609a52dcc6 (diff) | |
download | FreeBSD-src-5cec5b65a536337095eaeb2b594afe03910f4db5.zip FreeBSD-src-5cec5b65a536337095eaeb2b594afe03910f4db5.tar.gz |
Use a dedicated taskqueue with a thread that runs at a software-interrupt
priority for the periodic polling of the machine check registers.
Diffstat (limited to 'sys/x86')
-rw-r--r-- | sys/x86/x86/mca.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/x86/x86/mca.c b/sys/x86/x86/mca.c index 5ee090b..7ae3c78 100644 --- a/sys/x86/x86/mca.c +++ b/sys/x86/x86/mca.c @@ -105,6 +105,7 @@ SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0, 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"); |