Fix an edge case where objects can be returned to a per-cpu cache while
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 14 Apr 2006 02:58:49 +0000 (02:58 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 14 Apr 2006 02:58:49 +0000 (02:58 +0000)
commit208c0e5b1b554c7b4c6304a890692fd61c4a1797
treeb8af1f0c914ab97ed697efbea0a0e39e9ff1e168
parentcbeb1f72ec153d2ac1b19d98389eca27cb2e371e
Fix an edge case where objects can be returned to a per-cpu cache while
the objcache is blocked on the depot token.  the depot is found to be
exhausted and objcache blocks anyway.  Rechecking the per-cpu cache after
obtaining the token deals with the problem.

Normally this isn't a problem but on low-memory machines the objcache
is tight enough on memory that the returned objects could represent all
returnable objects at that time and a tsleep without checking for their
presence would block the calling thread forever.

Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
Also-thanks-to: Peter Holms filesystem and load testing suite (stress2).
sys/kern/kern_objcache.c