272
273 for (;;) {
274 if (cbuf_list_head != NULL && KCF_GSWQ_AVAIL >= GSWQ_MINFREE) {
275 mutex_exit(&cbuf_list_lock);
276 kcf_run_cbufcalls();
277 mutex_enter(&cbuf_list_lock);
278 }
279
280 if (cbuf_list_head != NULL) {
281 /*
282 * Wait 30 seconds for queue space to become available.
283 * This number is reasonable as it does not cause
284 * much CPU overhead. We could wait on a condition
285 * variable and the global software dequeue routine can
286 * signal us. But, it adds overhead to that routine
287 * which we want to avoid. Also, the client is prepared
288 * to wait any way.
289 */
290 CALLB_CPR_SAFE_BEGIN(&cprinfo);
291 mutex_exit(&cbuf_list_lock);
292 delay(30 * drv_usectohz(1000000));
293 mutex_enter(&cbuf_list_lock);
294 CALLB_CPR_SAFE_END(&cprinfo, &cbuf_list_lock);
295 }
296
297 /* Wait for new work to arrive */
298 if (cbuf_list_head == NULL) {
299 CALLB_CPR_SAFE_BEGIN(&cprinfo);
300 cv_wait(&cbuf_list_cv, &cbuf_list_lock);
301 CALLB_CPR_SAFE_END(&cprinfo, &cbuf_list_lock);
302 }
303 }
304 }
|
272
273 for (;;) {
274 if (cbuf_list_head != NULL && KCF_GSWQ_AVAIL >= GSWQ_MINFREE) {
275 mutex_exit(&cbuf_list_lock);
276 kcf_run_cbufcalls();
277 mutex_enter(&cbuf_list_lock);
278 }
279
280 if (cbuf_list_head != NULL) {
281 /*
282 * Wait 30 seconds for queue space to become available.
283 * This number is reasonable as it does not cause
284 * much CPU overhead. We could wait on a condition
285 * variable and the global software dequeue routine can
286 * signal us. But, it adds overhead to that routine
287 * which we want to avoid. Also, the client is prepared
288 * to wait any way.
289 */
290 CALLB_CPR_SAFE_BEGIN(&cprinfo);
291 mutex_exit(&cbuf_list_lock);
292 delay(drv_sectohz(30));
293 mutex_enter(&cbuf_list_lock);
294 CALLB_CPR_SAFE_END(&cprinfo, &cbuf_list_lock);
295 }
296
297 /* Wait for new work to arrive */
298 if (cbuf_list_head == NULL) {
299 CALLB_CPR_SAFE_BEGIN(&cprinfo);
300 cv_wait(&cbuf_list_cv, &cbuf_list_lock);
301 CALLB_CPR_SAFE_END(&cprinfo, &cbuf_list_lock);
302 }
303 }
304 }
|