Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Set the limit for deallocations in one transaction ...



details:   https://anonhg.NetBSD.org/src/rev/1e35eedfad09
branches:  trunk
changeset: 762157:1e35eedfad09
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Feb 16 19:43:05 2011 +0000

description:
Set the limit for deallocations in one transaction to a more realistic
(and much lower) value.  When flushing the log these deallocations will
produce new blocks and that may execeed the journal size resulting in
a "wapbl_flush: current transaction too big to flush" panic.
Seen when removing a large snapshot.

Adresses PR #44568 (WAPBL doens't play nice with snapshots).

diffstat:

 sys/kern/vfs_wapbl.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f51f402765a2 -r 1e35eedfad09 sys/kern/vfs_wapbl.c
--- a/sys/kern/vfs_wapbl.c      Wed Feb 16 19:33:48 2011 +0000
+++ b/sys/kern/vfs_wapbl.c      Wed Feb 16 19:43:05 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_wapbl.c,v 1.40 2011/02/14 16:05:11 bouyer Exp $    */
+/*     $NetBSD: vfs_wapbl.c,v 1.41 2011/02/16 19:43:05 hannken Exp $   */
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.40 2011/02/14 16:05:11 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.41 2011/02/16 19:43:05 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/bitops.h>
@@ -479,7 +479,7 @@
        wl->wl_bufcount_max = (nbuf / 2) * 1024;
 
        /* XXX tie this into resource estimation */
-       wl->wl_dealloclim = 2 * btodb(wl->wl_bufbytes_max);
+       wl->wl_dealloclim = wl->wl_bufbytes_max / mp->mnt_stat.f_bsize / 2;
        
        wl->wl_deallocblks = wapbl_malloc(sizeof(*wl->wl_deallocblks) *
            wl->wl_dealloclim);



Home | Main Index | Thread Index | Old Index