Execute last ZIO of log commit synchronously.
For short transactions overhead of context switch can be too large. Skipping it gives significant latency reduction. For large ones, including multiple ZIOs, latency is less critical, while throughput there may become limited by checksumming speed of single CPU core. To get best of both cases, execute last ZIO directly from calling thread context to save latency, while all others (if there are any) enqueue to taskqueues in traditional way. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
This commit is contained in:
parent
e93f9c7708
commit
6d1ccf40cc
@ -959,7 +959,7 @@ uint64_t zil_block_buckets[] = {
|
||||
* Calls are serialized.
|
||||
*/
|
||||
static lwb_t *
|
||||
zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb)
|
||||
zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb, boolean_t last)
|
||||
{
|
||||
lwb_t *nlwb = NULL;
|
||||
zil_chain_t *zilc;
|
||||
@ -1060,6 +1060,8 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb)
|
||||
*/
|
||||
bzero(lwb->lwb_buf + lwb->lwb_nused, wsz - lwb->lwb_nused);
|
||||
|
||||
if (last)
|
||||
lwb->lwb_zio->io_pipeline &= ~ZIO_STAGE_ISSUE_ASYNC;
|
||||
zio_nowait(lwb->lwb_zio); /* Kick off the write for the old log block */
|
||||
|
||||
/*
|
||||
@ -1103,7 +1105,7 @@ zil_lwb_commit(zilog_t *zilog, itx_t *itx, lwb_t *lwb)
|
||||
if (reclen > lwb_sp || (reclen + dlen > lwb_sp &&
|
||||
lwb_sp < ZIL_MAX_LOG_DATA / 8 && (dlen % ZIL_MAX_LOG_DATA == 0 ||
|
||||
lwb_sp < reclen + dlen % ZIL_MAX_LOG_DATA))) {
|
||||
lwb = zil_lwb_write_start(zilog, lwb);
|
||||
lwb = zil_lwb_write_start(zilog, lwb, B_FALSE);
|
||||
if (lwb == NULL)
|
||||
return (NULL);
|
||||
zil_lwb_write_init(zilog, lwb);
|
||||
@ -1560,7 +1562,7 @@ zil_commit_writer(zilog_t *zilog)
|
||||
|
||||
/* write the last block out */
|
||||
if (lwb != NULL && lwb->lwb_zio != NULL)
|
||||
lwb = zil_lwb_write_start(zilog, lwb);
|
||||
lwb = zil_lwb_write_start(zilog, lwb, B_TRUE);
|
||||
|
||||
zilog->zl_cur_used = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user