tech-kern archive

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

Re: crash in pipe_create()



On Fri, Feb 06, 2009 at 06:40:05PM +0900, enami tsugutomo wrote:

> Since the newly introduced pipe_ctor returns failure, pool_cache_get()
> has to check if the returned value isn't NULL even if it passes
> PR_WAIT.  Or, since we are allowed to wait, let uvm_km_alloc to wait
> also.
> 
> Of course, there might be yet another something seriously wrong.

While not indicative of something "seriously wrong" I think it would be
good for pool_cache_get() to invalidate the pool_cache if it cannot fetch
an item from the pool. This would flush per-CPU caches back to the pool.

        item = pool_get(&pc->pc_pool, PR_NOWAIT);
        if (__predict_false(item == NULL) && (flags & PR_WAITOK) != 0) {
                mutex_enter(&pc->pc_lock);
                inv = ratecheck(&pc->pc_invaltime, &pool_cache_invaltime);
                mutex_exit(&pc->pc_lock);
                if (inv) {
                        pool_cache_invalidate(pc);
                }
                item = pool_get(&pc->pc_pool, PR_WAITOK);
        }

Andrew


Home | Main Index | Thread Index | Old Index