diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-12-21 14:00:44 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-12-21 14:00:44 +0000 |
commit | 25f28a828c93ac124047dae57bd5aa71f55bd8a6 (patch) | |
tree | c7d6451f27955a5c3f3c39ca97313e3fc3eb55e9 /sys | |
parent | 5cded6af93cfd8b8b260495dd5c704e7452eac4a (diff) |
Ugly workaround in nmbclust_update(). Additionally to setting the limit
also modify the hiwat mark. This was done in pool_sethardlimit() until
rev. 1.99. Without this the mbuf cluster pool may return free pages too
quickly with the result that m_clget() may fail while populating DMA rings.
Seems to fix some hangs seen on MCLGETI() interfaces on i386 e.g. PR 6524.
A proper fix is to make all drivers handle empty rings but that will take
a while to implement. With and OK mikeb@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index bd5f8da413b..199849578e3 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.147 2010/11/05 15:17:50 claudio Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.148 2010/12/21 14:00:43 claudio Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -166,6 +166,14 @@ nmbclust_update(void) for (i = 0; i < nitems(mclsizes); i++) { (void)pool_sethardlimit(&mclpools[i], nmbclust, mclpool_warnmsg, 60); + /* + * XXX this needs to be reconsidered. + * Setting the high water mark to nmbclust is too high + * but we need to have enough spare buffers around so that + * allocations in interrupt context don't fail or mclgeti() + * drivers may end up with empty rings. + */ + pool_sethiwat(&mclpools[i], nmbclust); } pool_sethiwat(&mbpool, nmbclust); } |