txg.c (249858) | txg.c (251629) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 334 unchanged lines hidden (view full) --- 343 ASSERT(tc->tc_count[g] != 0); 344 if (--tc->tc_count[g] == 0) 345 cv_broadcast(&tc->tc_cv[g]); 346 mutex_exit(&tc->tc_lock); 347 348 th->th_cpu = NULL; /* defensive */ 349} 350 | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 334 unchanged lines hidden (view full) --- 343 ASSERT(tc->tc_count[g] != 0); 344 if (--tc->tc_count[g] == 0) 345 cv_broadcast(&tc->tc_cv[g]); 346 mutex_exit(&tc->tc_lock); 347 348 th->th_cpu = NULL; /* defensive */ 349} 350 |
351/* 352 * Blocks until all transactions in the group are committed. 353 * 354 * On return, the transaction group has reached a stable state in which it can 355 * then be passed off to the syncing context. 356 */ |
|
351static void 352txg_quiesce(dsl_pool_t *dp, uint64_t txg) 353{ 354 tx_state_t *tx = &dp->dp_tx; 355 int g = txg & TXG_MASK; 356 int c; 357 358 /* --- 33 unchanged lines hidden (view full) --- 392 393 list_destroy(cb_list); 394 395 kmem_free(cb_list, sizeof (list_t)); 396} 397 398/* 399 * Dispatch the commit callbacks registered on this txg to worker threads. | 357static void 358txg_quiesce(dsl_pool_t *dp, uint64_t txg) 359{ 360 tx_state_t *tx = &dp->dp_tx; 361 int g = txg & TXG_MASK; 362 int c; 363 364 /* --- 33 unchanged lines hidden (view full) --- 398 399 list_destroy(cb_list); 400 401 kmem_free(cb_list, sizeof (list_t)); 402} 403 404/* 405 * Dispatch the commit callbacks registered on this txg to worker threads. |
406 * 407 * If no callbacks are registered for a given TXG, nothing happens. 408 * This function creates a taskq for the associated pool, if needed. |
|
400 */ 401static void 402txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) 403{ 404 int c; 405 tx_state_t *tx = &dp->dp_tx; 406 list_t *cb_list; 407 408 for (c = 0; c < max_ncpus; c++) { 409 tx_cpu_t *tc = &tx->tx_cpu[c]; | 409 */ 410static void 411txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) 412{ 413 int c; 414 tx_state_t *tx = &dp->dp_tx; 415 list_t *cb_list; 416 417 for (c = 0; c < max_ncpus; c++) { 418 tx_cpu_t *tc = &tx->tx_cpu[c]; |
410 /* No need to lock tx_cpu_t at this point */ | 419 /* 420 * No need to lock tx_cpu_t at this point, since this can 421 * only be called once a txg has been synced. 422 */ |
411 412 int g = txg & TXG_MASK; 413 414 if (list_is_empty(&tc->tc_callbacks[g])) 415 continue; 416 417 if (tx->tx_commit_cb_taskq == NULL) { 418 /* --- 397 unchanged lines hidden --- | 423 424 int g = txg & TXG_MASK; 425 426 if (list_is_empty(&tc->tc_callbacks[g])) 427 continue; 428 429 if (tx->tx_commit_cb_taskq == NULL) { 430 /* --- 397 unchanged lines hidden --- |