Lines Matching refs:mtm
156 mt_map_t *mtm = ul->un_logmap; in top_issue_from_taskq() local
167 mutex_enter(&mtm->mtm_lock); in top_issue_from_taskq()
168 mtm->mtm_taskq_sync_count--; in top_issue_from_taskq()
169 if (mtm->mtm_taskq_sync_count == 0) { in top_issue_from_taskq()
170 cv_signal(&mtm->mtm_cv); in top_issue_from_taskq()
172 mutex_exit(&mtm->mtm_lock); in top_issue_from_taskq()
193 mt_map_t *mtm = ul->un_logmap; in top_begin_sync() local
201 mutex_enter(&mtm->mtm_lock); in top_begin_sync()
214 if (tp && (tp->last_async_tid != mtm->mtm_tid) && in top_begin_sync()
215 (tp->last_async_tid != mtm->mtm_committid)) { in top_begin_sync()
216 mutex_exit(&mtm->mtm_lock); in top_begin_sync()
227 if (((mtm->mtm_closed & (TOP_SYNC | TOP_ASYNC)) == in top_begin_sync()
228 (TOP_SYNC | TOP_ASYNC)) || mtm->mtm_activesync) { in top_begin_sync()
229 seq = mtm->mtm_seq; in top_begin_sync()
231 cv_wait(&mtm->mtm_cv_commit, &mtm->mtm_lock); in top_begin_sync()
232 } while (seq == mtm->mtm_seq); in top_begin_sync()
233 mutex_exit(&mtm->mtm_lock); in top_begin_sync()
237 if (mtm->mtm_closed & TOP_SYNC) { in top_begin_sync()
248 seq = mtm->mtm_seq; in top_begin_sync()
250 cv_wait(&mtm->mtm_cv_commit, &mtm->mtm_lock); in top_begin_sync()
251 } while (seq == mtm->mtm_seq); in top_begin_sync()
255 (tp->last_async_tid != mtm->mtm_tid) && in top_begin_sync()
256 (tp->last_async_tid != mtm->mtm_committid)) { in top_begin_sync()
257 mutex_exit(&mtm->mtm_lock); in top_begin_sync()
264 mtm->mtm_ref = 1; in top_begin_sync()
268 if ((mtm->mtm_closed & TOP_SYNC) && !panicstr) { in top_begin_sync()
277 (((mtm->mtm_closed & (TOP_SYNC | TOP_ASYNC)) == in top_begin_sync()
278 (TOP_SYNC | TOP_ASYNC)) || (mtm->mtm_activesync))) { in top_begin_sync()
279 seq = mtm->mtm_seq; in top_begin_sync()
281 cv_wait(&mtm->mtm_cv_commit, &mtm->mtm_lock); in top_begin_sync()
282 } while (seq == mtm->mtm_seq); in top_begin_sync()
283 mutex_exit(&mtm->mtm_lock); in top_begin_sync()
293 cv_wait(&mtm->mtm_cv_commit, &mtm->mtm_lock); in top_begin_sync()
299 mtm->mtm_wantin++; in top_begin_sync()
310 seq = mtm->mtm_seq; in top_begin_sync()
312 cv_wait(&mtm->mtm_cv_commit, &mtm->mtm_lock); in top_begin_sync()
313 } while (seq == mtm->mtm_seq); in top_begin_sync()
324 if (mtm->mtm_activesync == 0) { in top_begin_sync()
325 mutex_exit(&mtm->mtm_lock); in top_begin_sync()
327 mutex_enter(&mtm->mtm_lock); in top_begin_sync()
330 cv_wait(&mtm->mtm_cv_commit, &mtm->mtm_lock); in top_begin_sync()
336 mtm->mtm_active++; in top_begin_sync()
337 mtm->mtm_activesync++; in top_begin_sync()
341 ASSERT(mtm->mtm_active > 0); in top_begin_sync()
342 ASSERT(mtm->mtm_activesync > 0); in top_begin_sync()
343 mutex_exit(&mtm->mtm_lock); in top_begin_sync()
355 mt_map_t *mtm = ul->un_logmap; in top_begin_async() local
368 mutex_enter(&mtm->mtm_lock); in top_begin_async()
370 mtm->mtm_ref = 1; in top_begin_async()
374 if ((mtm->mtm_closed & TOP_ASYNC) && !panicstr) { in top_begin_async()
376 mutex_exit(&mtm->mtm_lock); in top_begin_async()
380 cv_wait(&mtm->mtm_cv_next, &mtm->mtm_lock); in top_begin_async()
409 if ((mtm->mtm_activesync == 0) && in top_begin_async()
410 (!(mtm->mtm_closed & TOP_SYNC_FORCED))) { in top_begin_async()
415 mtm->mtm_closed |= TOP_SYNC_FORCED; in top_begin_async()
416 mtm->mtm_taskq_sync_count++; in top_begin_async()
417 mutex_exit(&mtm->mtm_lock); in top_begin_async()
424 mutex_enter(&mtm->mtm_lock); in top_begin_async()
428 mutex_exit(&mtm->mtm_lock); in top_begin_async()
432 cv_wait(&mtm->mtm_cv_next, &mtm->mtm_lock); in top_begin_async()
438 mtm->mtm_active++; in top_begin_async()
441 ASSERT(mtm->mtm_active > 0); in top_begin_async()
442 mutex_exit(&mtm->mtm_lock); in top_begin_async()
454 mt_map_t *mtm = ul->un_logmap; in top_end_sync() local
460 top_end_debug(ul, mtm, topid, size)); in top_end_sync()
462 mutex_enter(&mtm->mtm_lock); in top_end_sync()
463 tid = mtm->mtm_tid; in top_end_sync()
465 mtm->mtm_activesync--; in top_end_sync()
466 mtm->mtm_active--; in top_end_sync()
468 mtm->mtm_ref = 1; in top_end_sync()
473 if (mtm->mtm_activesync || panicstr) { in top_end_sync()
474 ushort_t seq = mtm->mtm_seq; in top_end_sync()
476 mtm->mtm_closed = TOP_SYNC; in top_end_sync()
479 cv_wait(&mtm->mtm_cv_commit, &mtm->mtm_lock); in top_end_sync()
480 } while (seq == mtm->mtm_seq); in top_end_sync()
481 mutex_exit(&mtm->mtm_lock); in top_end_sync()
487 mtm->mtm_closed = TOP_SYNC|TOP_ASYNC; in top_end_sync()
492 while (mtm->mtm_active) { in top_end_sync()
493 cv_wait(&mtm->mtm_cv_eot, &mtm->mtm_lock); in top_end_sync()
504 mtm->mtm_tid = tid + 1; /* can overflow to 0 */ in top_end_sync()
509 mutex_enter(&mtm->mtm_mutex); in top_end_sync()
510 cancellist = mtm->mtm_cancel; in top_end_sync()
511 mtm->mtm_cancel = NULL; in top_end_sync()
512 mutex_exit(&mtm->mtm_mutex); in top_end_sync()
517 ASSERT(mtm->mtm_active == 0); in top_end_sync()
519 mtm->mtm_closed = TOP_SYNC; in top_end_sync()
526 mutex_exit(&mtm->mtm_lock); in top_end_sync()
527 cv_broadcast(&mtm->mtm_cv_next); in top_end_sync()
547 logmap_free_cancel(mtm, &cancellist); in top_end_sync()
553 mutex_enter(&mtm->mtm_lock); in top_end_sync()
554 mtm->mtm_active += mtm->mtm_wantin; in top_end_sync()
556 mtm->mtm_activesync = mtm->mtm_wantin; in top_end_sync()
557 mtm->mtm_wantin = 0; in top_end_sync()
558 mtm->mtm_closed = 0; in top_end_sync()
560 mtm->mtm_committid = mtm->mtm_tid; in top_end_sync()
561 mtm->mtm_seq++; in top_end_sync()
562 mutex_exit(&mtm->mtm_lock); in top_end_sync()
568 cv_broadcast(&mtm->mtm_cv_commit); in top_end_sync()
573 if (logmap_need_roll_sync(mtm)) { in top_end_sync()
574 logmap_forceroll_nowait(mtm); in top_end_sync()
587 mt_map_t *mtm = ul->un_logmap; in top_end_async() local
594 top_end_debug(ul, mtm, topid, size)); in top_end_async()
596 mutex_enter(&mtm->mtm_lock); in top_end_async()
602 tp->last_async_tid = mtm->mtm_tid; in top_end_async()
604 mtm->mtm_ref = 1; in top_end_async()
606 mtm->mtm_active--; in top_end_async()
607 if ((mtm->mtm_active == 0) && in top_end_async()
608 (mtm->mtm_closed == (TOP_SYNC|TOP_ASYNC))) { in top_end_async()
611 mutex_exit(&mtm->mtm_lock); in top_end_async()
613 cv_signal(&mtm->mtm_cv_eot); in top_end_async()
620 if ((mtm->mtm_activesync == 0) && in top_end_async()
621 !(mtm->mtm_closed & TOP_SYNC) && in top_end_async()
623 logmap_need_commit(mtm) || in top_end_async()
631 if (logmap_need_roll_async(mtm)) in top_end_async()
632 logmap_forceroll_nowait(mtm); in top_end_async()