HAMMER 39B/Many: Cleanup pass
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 29 Apr 2008 04:43:08 +0000 (04:43 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 29 Apr 2008 04:43:08 +0000 (04:43 +0000)
* Correct an issue where an inode flush was not being immediately picked
  up by the flusher, causing frontend I/O to stall.

sys/vfs/hammer/hammer_flusher.c
sys/vfs/hammer/hammer_inode.c

index f74092c..d2c698e 100644 (file)
@@ -31,7 +31,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $DragonFly: src/sys/vfs/hammer/hammer_flusher.c,v 1.7 2008/04/29 01:10:37 dillon Exp $
+ * $DragonFly: src/sys/vfs/hammer/hammer_flusher.c,v 1.8 2008/04/29 04:43:08 dillon Exp $
  */
 /*
  * HAMMER dependancy flusher thread
@@ -107,6 +107,13 @@ hammer_flusher_thread(void *arg)
                hammer_flusher_clean_loose_ios(hmp);
                hmp->flusher_act = seq;
                wakeup(&hmp->flusher_act);
+
+               /*
+                * Loop if more got queued after our demark.
+                */
+               if (TAILQ_NEXT(hmp->flusher_demark, flush_entry))
+                       continue;
+
                if (hmp->flusher_exiting)
                        break;
                while (hmp->flusher_seq == hmp->flusher_act)
index 097f3fc..d9cbef2 100644 (file)
@@ -31,7 +31,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $DragonFly: src/sys/vfs/hammer/hammer_inode.c,v 1.43 2008/04/29 01:10:37 dillon Exp $
+ * $DragonFly: src/sys/vfs/hammer/hammer_inode.c,v 1.44 2008/04/29 04:43:08 dillon Exp $
  */
 
 #include "hammer.h"
@@ -702,10 +702,14 @@ hammer_flush_inode(hammer_inode_t ip, int flags)
        KKASSERT((ip->flags & HAMMER_INODE_NEW) == 0);
        if (ip->flush_state != HAMMER_FST_IDLE &&
            (ip->flags & HAMMER_INODE_MODMASK)) {
-               ip->flags |= HAMMER_INODE_REFLUSH;
-               if (flags & HAMMER_FLUSH_RELEASE) {
-                       hammer_unref(&ip->lock);
-                       KKASSERT(ip->lock.refs > 0);
+               if ((ip->flags & HAMMER_INODE_REFLUSH) == 0) {
+                       ip->flags |= HAMMER_INODE_REFLUSH;
+                       if (flags & HAMMER_FLUSH_RELEASE) {
+                               hammer_unref(&ip->lock);
+                               KKASSERT(ip->lock.refs > 0);
+                       }
+                       if (flags & HAMMER_FLUSH_SIGNAL)
+                               hammer_flusher_async(ip->hmp);
                }
                return;
        }