version 1.219, 2017/12/16 03:13:29 |
version 1.220, 2017/12/29 16:13:26 |
Line 1088 pool_grow(struct pool *pp, int flags) |
|
Line 1088 pool_grow(struct pool *pp, int flags) |
|
} |
} |
} |
} |
pp->pr_flags |= PR_GROWING; |
pp->pr_flags |= PR_GROWING; |
if ((flags & PR_WAITOK) == 0) |
if (flags & PR_WAITOK) |
|
mutex_exit(&pp->pr_lock); |
|
else |
pp->pr_flags |= PR_GROWINGNOWAIT; |
pp->pr_flags |= PR_GROWINGNOWAIT; |
|
|
mutex_exit(&pp->pr_lock); |
|
char *cp = pool_allocator_alloc(pp, flags); |
char *cp = pool_allocator_alloc(pp, flags); |
if (__predict_false(cp == NULL)) |
if (__predict_false(cp == NULL)) |
goto out; |
goto out; |
Line 1102 pool_grow(struct pool *pp, int flags) |
|
Line 1103 pool_grow(struct pool *pp, int flags) |
|
goto out; |
goto out; |
} |
} |
|
|
mutex_enter(&pp->pr_lock); |
if (flags & PR_WAITOK) |
|
mutex_enter(&pp->pr_lock); |
pool_prime_page(pp, cp, ph); |
pool_prime_page(pp, cp, ph); |
pp->pr_npagealloc++; |
pp->pr_npagealloc++; |
KASSERT(pp->pr_flags & PR_GROWING); |
KASSERT(pp->pr_flags & PR_GROWING); |
Line 1114 pool_grow(struct pool *pp, int flags) |
|
Line 1116 pool_grow(struct pool *pp, int flags) |
|
cv_broadcast(&pp->pr_cv); |
cv_broadcast(&pp->pr_cv); |
return 0; |
return 0; |
out: |
out: |
|
if (flags & PR_WAITOK) |
|
mutex_enter(&pp->pr_lock); |
KASSERT(pp->pr_flags & PR_GROWING); |
KASSERT(pp->pr_flags & PR_GROWING); |
pp->pr_flags &= ~(PR_GROWING|PR_GROWINGNOWAIT); |
pp->pr_flags &= ~(PR_GROWING|PR_GROWINGNOWAIT); |
mutex_enter(&pp->pr_lock); |
|
return ENOMEM; |
return ENOMEM; |
} |
} |
|
|