diff options
author | jeff <jeff@FreeBSD.org> | 2002-09-26 07:38:56 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-09-26 07:38:56 +0000 |
commit | 536752d4811eec3de96155aaa1aa24b60ec8cfe9 (patch) | |
tree | faa523d022b785f2fe6a5e81cdf91927ca3d68e5 /sys/kern | |
parent | e06443596c8639461726101bce9a4096ea4b44bf (diff) | |
download | FreeBSD-src-536752d4811eec3de96155aaa1aa24b60ec8cfe9.zip FreeBSD-src-536752d4811eec3de96155aaa1aa24b60ec8cfe9.tar.gz |
- Export the alq daemon thread pointer.
- Don't log ktr events from the alq daemon.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_alq.c | 11 | ||||
-rw-r--r-- | sys/kern/kern_ktr.c | 3 |
2 files changed, 9 insertions, 5 deletions
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) { |