From 536752d4811eec3de96155aaa1aa24b60ec8cfe9 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 26 Sep 2002 07:38:56 +0000 Subject: - Export the alq daemon thread pointer. - Don't log ktr events from the alq daemon. --- sys/kern/kern_alq.c | 11 +++++++---- sys/kern/kern_ktr.c | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c index ab0c7a0..7ddacc8 100644 --- a/sys/kern/kern_alq.c +++ b/sys/kern/kern_alq.c @@ -74,8 +74,9 @@ static MALLOC_DEFINE(M_ALD, "ALD", "ALD"); static struct mtx ald_mtx; static LIST_HEAD(, alq) ald_queues; static LIST_HEAD(, alq) ald_active; -static struct proc *ald_thread; static int ald_shutingdown = 0; +struct thread *ald_thread; +static struct proc *ald_proc; #define ALD_LOCK() mtx_lock(&ald_mtx) #define ALD_UNLOCK() mtx_unlock(&ald_mtx) @@ -170,6 +171,8 @@ ald_daemon(void) mtx_lock(&Giant); + ald_thread = FIRST_THREAD_IN_PROC(ald_proc); + EVENTHANDLER_REGISTER(shutdown_pre_sync, ald_shutdown, NULL, SHUTDOWN_PRI_FIRST); @@ -224,7 +227,7 @@ alq_shutdown(struct alq *alq) } ALQ_UNLOCK(alq); - vn_close(alq->aq_vp, FREAD|FWRITE, alq->aq_cred, + vn_close(alq->aq_vp, FWRITE, alq->aq_cred, curthread); crfree(alq->aq_cred); } @@ -310,7 +313,7 @@ alq_doio(struct alq *alq) static struct kproc_desc ald_kp = { "ALQ Daemon", ald_daemon, - &ald_thread + &ald_proc }; SYSINIT(aldthread, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, kproc_start, &ald_kp) @@ -339,7 +342,7 @@ alq_open(struct alq **alqp, const char *file, int size, int count) td = curthread; NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td); - flags = FREAD | FWRITE | O_NOFOLLOW | O_CREAT; + flags = FWRITE | O_NOFOLLOW | O_CREAT; error = vn_open(&nd, &flags, 0); if (error) diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index 1d31d12..8a88bd8 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -195,7 +195,8 @@ ktr_tracepoint(u_int mask, const char *file, int line, const char *format, #ifdef KTR_ALQ if (ktr_alq_enabled && td->td_critnest == 0 && - (td->td_kse->ke_flags & KEF_IDLEKSE) == 0) { + (td->td_kse->ke_flags & KEF_IDLEKSE) == 0 && + td != ald_thread) { if (ktr_alq_max && ktr_alq_cnt > ktr_alq_max) goto done; if ((ale = alq_get(ktr_alq, ALQ_NOWAIT)) == NULL) { -- cgit v1.1