From bea18fb70247139535664c5bda5bcb009deb9bcd Mon Sep 17 00:00:00 2001 From: pooka Date: Thu, 1 Oct 2009 12:28:34 +0000 Subject: [PATCH] Add dealloccnt to list of things to be considered in the stetson-harrison decision making algorithm for flushing a wapbl transation. --- sys/kern/vfs_wapbl.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_wapbl.c b/sys/kern/vfs_wapbl.c index 5798efec3240..f42b55bc5753 100644 --- a/sys/kern/vfs_wapbl.c +++ b/sys/kern/vfs_wapbl.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_wapbl.c,v 1.27 2009/10/01 07:42:45 pooka Exp $ */ +/* $NetBSD: vfs_wapbl.c,v 1.28 2009/10/01 12:28:34 pooka Exp $ */ /*- * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #define WAPBL_INTERNAL #include -__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.27 2009/10/01 07:42:45 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.28 2009/10/01 12:28:34 pooka Exp $"); #include @@ -784,16 +784,20 @@ wapbl_begin(struct wapbl *wl, const char *file, int line) wl->wl_bufbytes_max / 2) || ((wl->wl_bufcount + (lockcount * 10)) > wl->wl_bufcount_max / 2) || - (wapbl_transaction_len(wl) > wl->wl_circ_size / 2); + (wapbl_transaction_len(wl) > wl->wl_circ_size / 2) || + (wl->wl_dealloccnt >= + (wl->wl_dealloclim - (wl->wl_dealloclim >> 8))); mutex_exit(&wl->wl_mtx); if (doflush) { WAPBL_PRINTF(WAPBL_PRINT_FLUSH, ("force flush lockcnt=%d bufbytes=%zu " - "(max=%zu) bufcount=%zu (max=%zu)\n", + "(max=%zu) bufcount=%zu (max=%zu) " + "dealloccnt %d (lim=%d)\n", lockcount, wl->wl_bufbytes, wl->wl_bufbytes_max, wl->wl_bufcount, - wl->wl_bufcount_max)); + wl->wl_bufcount_max, + wl->wl_dealloccnt, wl->wl_dealloclim)); } if (doflush) {