Report result of pool_reclaim() from pool_drain_end().

This commit is contained in:
pooka 2010-06-03 10:40:17 +00:00
parent 7f1fb6416b
commit d71ac89211
2 changed files with 10 additions and 7 deletions

View File

@ -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 @@ pool_drain_start(struct pool **ppp, uint64_t *wp)
}
}
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 @@ pool_drain_end(struct pool *pp, uint64_t where)
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;
}
/*

View File

@ -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_setlowat(struct pool *, int);
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.