tech-kern archive

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

Re: getiobuf(x, false) can sleep ?



On Fri, Apr 02, 2010 at 06:30:30PM +0900, enami tsugutomo wrote:
> > When called this way getiobuf() will do pool_cache_get(bufio_cache,
> > PR_NOWAIT).  Does anyone see if this can sleep somewhere despite the
> > PR_NOWAIT ?
> 
> The mutex_enter() in the pool_cache_get_slow()?

This cache won't sleep if PR_NOWAIT, it's interrupt safe.

You could verify the context switch theory using something like:

        uint64_t pctr;

        kpreempt_disable();
        pctr = lwp_pctr();
        /* do stuff */
        KASSERT(pctr == lwp_pctr());    /* check for context switch */
        kpreempt_enable();



Home | Main Index | Thread Index | Old Index