Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Keep track of the number of segments reclaimed, ...



details:   https://anonhg.NetBSD.org/src/rev/f3b209f45543
branches:  trunk
changeset: 581029:f3b209f45543
user:      perseant <perseant%NetBSD.org@localhost>
date:      Fri May 20 19:48:25 2005 +0000

description:
Keep track of the number of segments reclaimed, since the cleaner doesn't
do this anymore (it hasn't for quite some time).  Add a couple of conditional
debugging messages to indicate why segments are not cleaned, in the event
that lfs_segclean is used.

Make the LFCNSEGWAITALL fcntl work again.

diffstat:

 sys/ufs/lfs/lfs.h          |   3 ++-
 sys/ufs/lfs/lfs_syscalls.c |  12 +++++++++---
 sys/ufs/lfs/lfs_vfsops.c   |   5 +++--
 3 files changed, 14 insertions(+), 6 deletions(-)

diffs (94 lines):

diff -r 014bae202b0e -r f3b209f45543 sys/ufs/lfs/lfs.h
--- a/sys/ufs/lfs/lfs.h Fri May 20 19:09:25 2005 +0000
+++ b/sys/ufs/lfs/lfs.h Fri May 20 19:48:25 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs.h,v 1.86 2005/04/23 19:47:51 perseant Exp $        */
+/*     $NetBSD: lfs.h,v 1.87 2005/05/20 19:48:25 perseant Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -1058,6 +1058,7 @@
        u_int   vflush_invoked;
        u_int   clean_inlocked;
        u_int   clean_vnlocked;
+       u_int   segs_reclaimed;
 };
 #ifdef _KERNEL
 extern struct lfs_stats lfs_stats;
diff -r 014bae202b0e -r f3b209f45543 sys/ufs/lfs/lfs_syscalls.c
--- a/sys/ufs/lfs/lfs_syscalls.c        Fri May 20 19:09:25 2005 +0000
+++ b/sys/ufs/lfs/lfs_syscalls.c        Fri May 20 19:48:25 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_syscalls.c,v 1.105 2005/04/16 17:28:37 perseant Exp $      */
+/*     $NetBSD: lfs_syscalls.c,v 1.106 2005/05/20 19:48:25 perseant Exp $      */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.105 2005/04/16 17:28:37 perseant Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.106 2005/05/20 19:48:25 perseant Exp $");
 
 #ifndef LFS
 # define LFS           /* for prototypes in syscallargs.h */
@@ -893,10 +893,14 @@
                return (EBUSY);
        }
        if (sup->su_flags & SEGUSE_ACTIVE) {
+               DLOG((DLOG_CLEAN, "lfs_segclean: not cleaning segment %lu:"
+                     " segment is active\n", segnum));
                brelse(bp);
                return (EBUSY);
        }
        if (!(sup->su_flags & SEGUSE_DIRTY)) {
+               DLOG((DLOG_CLEAN, "lfs_segclean: not cleaning segment %lu:"
+                     " segment is already clean\n", segnum));
                brelse(bp);
                return (EALREADY);
        }
@@ -929,6 +933,8 @@
        (void) LFS_BWRITE_LOG(bp);
        wakeup(&fs->lfs_avail);
 
+       ++lfs_stats.segs_reclaimed;
+
        return (0);
 }
 
@@ -945,7 +951,7 @@
        u_long timeout;
        int error, s;
 
-       if ((mntp = vfs_getvfs(fsidp)) == NULL)
+       if (fsidp == NULL || (mntp = vfs_getvfs(fsidp)) == NULL)
                addr = &lfs_allclean_wakeup;
        else
                addr = &VFSTOUFS(mntp)->um_lfs->lfs_nextseg;
diff -r 014bae202b0e -r f3b209f45543 sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c  Fri May 20 19:09:25 2005 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c  Fri May 20 19:48:25 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vfsops.c,v 1.179 2005/05/20 19:03:11 perseant Exp $        */
+/*     $NetBSD: lfs_vfsops.c,v 1.180 2005/05/20 19:48:25 perseant Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.179 2005/05/20 19:03:11 perseant Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.180 2005/05/20 19:48:25 perseant Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -1796,6 +1796,7 @@
                { "vflush_invoked", "Number of time vflush was called" },
                { "clean_inlocked", "Number of vnodes skipped for VXLOCK" },
                { "clean_vnlocked", "Number of vnodes skipped for vget failure" },
+               { "segs_reclaimed", "Number of segments reclaimed" },
        };
 
        sysctl_createv(clog, 0, NULL, NULL,



Home | Main Index | Thread Index | Old Index