Module Name: src
Committed By: pooka
Date: Thu Jun 3 10:40:17 UTC 2010
Modified Files:
src/sys/kern: subr_pool.c
src/sys/sys: pool.h
Log Message:
Report result of pool_reclaim() from pool_drain_end().
To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.69 -r1.70 src/sys/sys/pool.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.185 src/sys/kern/subr_pool.c:1.186
--- src/sys/kern/subr_pool.c:1.185 Wed May 12 08:11:16 2010
+++ src/sys/kern/subr_pool.c Thu Jun 3 10:40:17 2010
@@ -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;
}
/*
Index: src/sys/sys/pool.h
diff -u src/sys/sys/pool.h:1.69 src/sys/sys/pool.h:1.70
--- src/sys/sys/pool.h:1.69 Sun May 30 02:28:13 2010
+++ src/sys/sys/pool.h Thu Jun 3 10:40:17 2010
@@ -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.