Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/puffs Fix hang unmount bug introduced by last commit.



details:   https://anonhg.NetBSD.org/src/rev/5a3d4e62c552
branches:  trunk
changeset: 780397:5a3d4e62c552
user:      manu <manu%NetBSD.org@localhost>
date:      Sun Jul 22 17:40:46 2012 +0000

description:
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.

diffstat:

 sys/fs/puffs/puffs_msgif.c  |  15 +++++++--------
 sys/fs/puffs/puffs_vfsops.c |   5 ++---
 2 files changed, 9 insertions(+), 11 deletions(-)

diffs (79 lines):

diff -r ecfcd48588f9 -r 5a3d4e62c552 sys/fs/puffs/puffs_msgif.c
--- a/sys/fs/puffs/puffs_msgif.c        Sun Jul 22 17:14:18 2012 +0000
+++ b/sys/fs/puffs/puffs_msgif.c        Sun Jul 22 17:40:46 2012 +0000
@@ -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 @@
                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 @@
                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 @@
        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;
diff -r ecfcd48588f9 -r 5a3d4e62c552 sys/fs/puffs/puffs_vfsops.c
--- a/sys/fs/puffs/puffs_vfsops.c       Sun Jul 22 17:14:18 2012 +0000
+++ b/sys/fs/puffs/puffs_vfsops.c       Sun Jul 22 17:40:46 2012 +0000
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index