Module Name: src
Committed By: manu
Date: Sun Jul 22 17:40:46 UTC 2012
Modified Files:
src/sys/fs/puffs: puffs_msgif.c puffs_vfsops.c
Log Message:
Fix hang unmount bug introduced by last commit.
We introduced a slow queue for delayed reclaims, while the existing
queue for unmount, flush and exist has been renamed fast queue. Both
queues had timestamp for when an operation should be done, but it was
useless for the fast queue, which is always used to run an operation
ASAP. And the timestamp test had an error that turned ASAP into "at next
tick", but nobody what there to wake the thread at next tick, hence
the hang. The fix is to remove the useless and buggy timestamp test for
fast queue.
To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.102 -r1.103 src/sys/fs/puffs/puffs_vfsops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/fs/puffs/puffs_msgif.c
diff -u src/sys/fs/puffs/puffs_msgif.c:1.90 src/sys/fs/puffs/puffs_msgif.c:1.91
--- src/sys/fs/puffs/puffs_msgif.c:1.90 Sat Jul 21 05:17:10 2012
+++ src/sys/fs/puffs/puffs_msgif.c Sun Jul 22 17:40:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_msgif.c,v 1.90 2012/07/21 05:17:10 manu Exp $ */
+/* $NetBSD: puffs_msgif.c,v 1.91 2012/07/22 17:40:46 manu Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.90 2012/07/21 05:17:10 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.91 2012/07/22 17:40:46 manu Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -986,7 +986,6 @@ puffs_msgif_dispatch(void *this, struct
psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
memcpy(&psopr->psopr_pf, pf, sizeof(*pf));
psopr->psopr_sopreq = PUFFS_SOPREQ_FLUSH;
- psopr->psopr_at = hardclock_ticks;
mutex_enter(&pmp->pmp_sopmtx);
if (pmp->pmp_sopthrcount == 0) {
@@ -1011,7 +1010,6 @@ puffs_msgif_dispatch(void *this, struct
psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
psopr->psopr_preq = *preq;
psopr->psopr_sopreq = PUFFS_SOPREQ_UNMOUNT;
- psopr->psopr_at = hardclock_ticks;
mutex_enter(&pmp->pmp_sopmtx);
if (pmp->pmp_sopthrcount == 0) {
@@ -1061,13 +1059,14 @@ puffs_sop_thread(void *arg)
for (keeprunning = true; keeprunning; ) {
/*
* We have a higher priority queue for flush and umount
- * and a lower priority queue for reclaims. Request are
- * not honoured before clock reaches psopr_at. This code
- * assumes that requests are ordered by psopr_at in queues.
+ * and a lower priority queue for reclaims. Request on
+ * slower queue are not honoured before clock reaches
+ * psopr_at. This code assumes that requests are ordered
+ * by psopr_at in queues.
*/
do {
psopr = TAILQ_FIRST(&pmp->pmp_sopfastreqs);
- if ((psopr != NULL) && TIMED_OUT(psopr->psopr_at)) {
+ if (psopr != NULL) {
TAILQ_REMOVE(&pmp->pmp_sopfastreqs,
psopr, psopr_entries);
break;
Index: src/sys/fs/puffs/puffs_vfsops.c
diff -u src/sys/fs/puffs/puffs_vfsops.c:1.102 src/sys/fs/puffs/puffs_vfsops.c:1.103
--- src/sys/fs/puffs/puffs_vfsops.c:1.102 Sat Jul 21 05:17:11 2012
+++ src/sys/fs/puffs/puffs_vfsops.c Sun Jul 22 17:40:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_vfsops.c,v 1.102 2012/07/21 05:17:11 manu Exp $ */
+/* $NetBSD: puffs_vfsops.c,v 1.103 2012/07/22 17:40:46 manu Exp $ */
/*
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.102 2012/07/21 05:17:11 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.103 2012/07/22 17:40:46 manu Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -422,7 +422,6 @@ puffs_vfsop_unmount(struct mount *mp, in
KASSERT(curlwp != uvm.pagedaemon_lwp);
psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
psopr->psopr_sopreq = PUFFS_SOPREQSYS_EXIT;
- psopr->psopr_at = hardclock_ticks;
mutex_enter(&pmp->pmp_sopmtx);
if (pmp->pmp_sopthrcount == 0) {
mutex_exit(&pmp->pmp_sopmtx);