Source-Changes-HG archive

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

[src/trunk]: src/sys Report result of pool_reclaim() from pool_drain_end().



details:   https://anonhg.NetBSD.org/src/rev/495b9b8072ac
branches:  trunk
changeset: 755369:495b9b8072ac
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Jun 03 10:40:17 2010 +0000

description:
Report result of pool_reclaim() from pool_drain_end().

diffstat:

 sys/kern/subr_pool.c |  13 ++++++++-----
 sys/sys/pool.h       |   4 ++--
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (69 lines):

diff -r 99944074dae8 -r 495b9b8072ac sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c      Thu Jun 03 10:38:34 2010 +0000
+++ b/sys/kern/subr_pool.c      Thu Jun 03 10:40:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_pool.c,v 1.185 2010/05/12 08:11:16 rmind Exp $    */
+/*     $NetBSD: subr_pool.c,v 1.186 2010/06/03 10:40:17 pooka Exp $    */
 
 /*-
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.185 2010/05/12 08:11:16 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.186 2010/06/03 10:40:17 pooka Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pool.h"
@@ -1745,12 +1745,13 @@
        }
 }
 
-void
+bool
 pool_drain_end(struct pool *pp, uint64_t where)
 {
+       bool reclaimed;
 
        if (pp == NULL)
-               return;
+               return false;
 
        KASSERT(pp->pr_refcnt > 0);
 
@@ -1759,13 +1760,15 @@
                xc_wait(where);
 
        /* Drain the cache (if any) and pool.. */
-       pool_reclaim(pp);
+       reclaimed = pool_reclaim(pp);
 
        /* Finally, unlock the pool. */
        mutex_enter(&pool_head_lock);
        pp->pr_refcnt--;
        cv_broadcast(&pool_busy);
        mutex_exit(&pool_head_lock);
+
+       return reclaimed;
 }
 
 /*
diff -r 99944074dae8 -r 495b9b8072ac sys/sys/pool.h
--- a/sys/sys/pool.h    Thu Jun 03 10:38:34 2010 +0000
+++ b/sys/sys/pool.h    Thu Jun 03 10:40:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pool.h,v 1.69 2010/05/30 02:28:13 dholland Exp $       */
+/*     $NetBSD: pool.h,v 1.70 2010/06/03 10:40:17 pooka Exp $  */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2000, 2007 The NetBSD Foundation, Inc.
@@ -295,7 +295,7 @@
 void           pool_sethiwat(struct pool *, int);
 void           pool_sethardlimit(struct pool *, int, const char *, int);
 void           pool_drain_start(struct pool **, uint64_t *);
-void           pool_drain_end(struct pool *, uint64_t);
+bool           pool_drain_end(struct pool *, uint64_t);
 
 /*
  * Debugging and diagnostic aides.



Home | Main Index | Thread Index | Old Index