Source-Changes-D archive

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

Re: CVS commit: src/sys/kern

On 11.03.2013 23:56, YAMAMOTO Takashi wrote:
Module Name:    src
Committed By:   pooka
Date:           Mon Mar 11 21:37:54 UTC 2013

Modified Files:
        src/sys/kern: subr_pool.c

Log Message:
In pool_cache_put_slow(), pool_get() can block (it does mutex_enter()),
so we need to retry if curlwp took a context switch during the call.
Otherwise, CPU-local invariants can get screwed up:

     panic: kernel diagnostic assertion "cur->pcg_avail == cur->pcg_size" failed

This is (was) very easy to reproduce by just running:

   while : ; do RUMP_NCPU=32 ./a.out ; done

where a.out only calls rump_init().  But, any situation there's contention
and a pool doesn't have emptygroups would do.

depending on mutex_init's arguments (type and ipl), a mutex can be
spin or adaptive.
rump mutex implementation should honor the behaviour, i guess.

Oh bummer, forgot that mutex_enter() can be a spin mutex entry. Yea, I'll fix that soon and convert the otherwise harmless back-off to a KASSERT() -- I found some similar invariant failures with a websearch, so it might be a common problem.

  - antti

Home | Main Index | Thread Index | Old Index