zio_impl.h (243503) | zio_impl.h (243524) |
---|---|
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 --- 24 unchanged lines hidden (view full) --- 33#include <sys/zfs_context.h> 34#include <sys/zio.h> 35 36#ifdef __cplusplus 37extern "C" { 38#endif 39 40/* | 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 --- 24 unchanged lines hidden (view full) --- 33#include <sys/zfs_context.h> 34#include <sys/zio.h> 35 36#ifdef __cplusplus 37extern "C" { 38#endif 39 40/* |
41 * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. 42 * 43 * The ZFS I/O pipeline is comprised of various stages which are defined 44 * in the zio_stage enum below. The individual stages are used to construct 45 * these basic I/O operations: Read, Write, Free, Claim, and Ioctl. 46 * 47 * I/O operations: (XXX - provide detail for each of the operations) 48 * 49 * Read: 50 * Write: 51 * Free: 52 * Claim: 53 * Ioctl: 54 * 55 * Although the most common pipeline are used by the basic I/O operations 56 * above, there are some helper pipelines (one could consider them 57 * sub-pipelines) which are used internally by the ZIO module and are 58 * explained below: 59 * 60 * Interlock Pipeline: 61 * The interlock pipeline is the most basic pipeline and is used by all 62 * of the I/O operations. The interlock pipeline does not perform any I/O 63 * and is used to coordinate the dependencies between I/Os that are being 64 * issued (i.e. the parent/child relationship). 65 * 66 * Vdev child Pipeline: 67 * The vdev child pipeline is responsible for performing the physical I/O. 68 * It is in this pipeline where the I/O are queued and possibly cached. 69 * 70 * In addition to performing I/O, the pipeline is also responsible for 71 * data transformations. The transformations performed are based on the 72 * specific properties that user may have selected and modify the 73 * behavior of the pipeline. Examples of supported transformations are 74 * compression, dedup, and nop writes. Transformations will either modify 75 * the data or the pipeline. This list below further describes each of 76 * the supported transformations: 77 * 78 * Compression: 79 * ZFS supports three different flavors of compression -- gzip, lzjb, and 80 * zle. Compression occurs as part of the write pipeline and is performed 81 * in the ZIO_STAGE_WRITE_BP_INIT stage. 82 * 83 * Dedup: 84 * Dedup reads are handled by the ZIO_STAGE_DDT_READ_START and 85 * ZIO_STAGE_DDT_READ_DONE stages. These stages are added to an existing 86 * read pipeline if the dedup bit is set on the block pointer. 87 * Writing a dedup block is performed by the ZIO_STAGE_DDT_WRITE stage 88 * and added to a write pipeline if a user has enabled dedup on that 89 * particular dataset. 90 * 91 * NOP Write: 92 * The NOP write feature is performed by the ZIO_STAGE_NOP_WRITE stage 93 * and is added to an existing write pipeline if a crypographically 94 * secure checksum (i.e. SHA256) is enabled and compression is turned on. 95 * The NOP write stage will compare the checksums of the current data 96 * on-disk (level-0 blocks only) and the data that is currently being written. 97 * If the checksum values are identical then the pipeline is converted to 98 * an interlock pipeline skipping block allocation and bypassing the 99 * physical I/O. The nop write feature can handle writes in either 100 * syncing or open context (i.e. zil writes) and as a result is mutually 101 * exclusive with dedup. 102 */ 103 104/* |
|
41 * zio pipeline stage definitions 42 */ 43enum zio_stage { 44 ZIO_STAGE_OPEN = 1 << 0, /* RWFCI */ 45 46 ZIO_STAGE_READ_BP_INIT = 1 << 1, /* R---- */ 47 ZIO_STAGE_FREE_BP_INIT = 1 << 2, /* --F-- */ 48 ZIO_STAGE_ISSUE_ASYNC = 1 << 3, /* RWF-- */ 49 ZIO_STAGE_WRITE_BP_INIT = 1 << 4, /* -W--- */ 50 51 ZIO_STAGE_CHECKSUM_GENERATE = 1 << 5, /* -W--- */ 52 | 105 * zio pipeline stage definitions 106 */ 107enum zio_stage { 108 ZIO_STAGE_OPEN = 1 << 0, /* RWFCI */ 109 110 ZIO_STAGE_READ_BP_INIT = 1 << 1, /* R---- */ 111 ZIO_STAGE_FREE_BP_INIT = 1 << 2, /* --F-- */ 112 ZIO_STAGE_ISSUE_ASYNC = 1 << 3, /* RWF-- */ 113 ZIO_STAGE_WRITE_BP_INIT = 1 << 4, /* -W--- */ 114 115 ZIO_STAGE_CHECKSUM_GENERATE = 1 << 5, /* -W--- */ 116 |
53 ZIO_STAGE_DDT_READ_START = 1 << 6, /* R---- */ 54 ZIO_STAGE_DDT_READ_DONE = 1 << 7, /* R---- */ 55 ZIO_STAGE_DDT_WRITE = 1 << 8, /* -W--- */ 56 ZIO_STAGE_DDT_FREE = 1 << 9, /* --F-- */ | 117 ZIO_STAGE_NOP_WRITE = 1 << 6, /* -W--- */ |
57 | 118 |
58 ZIO_STAGE_GANG_ASSEMBLE = 1 << 10, /* RWFC- */ 59 ZIO_STAGE_GANG_ISSUE = 1 << 11, /* RWFC- */ | 119 ZIO_STAGE_DDT_READ_START = 1 << 7, /* R---- */ 120 ZIO_STAGE_DDT_READ_DONE = 1 << 8, /* R---- */ 121 ZIO_STAGE_DDT_WRITE = 1 << 9, /* -W--- */ 122 ZIO_STAGE_DDT_FREE = 1 << 10, /* --F-- */ |
60 | 123 |
61 ZIO_STAGE_DVA_ALLOCATE = 1 << 12, /* -W--- */ 62 ZIO_STAGE_DVA_FREE = 1 << 13, /* --F-- */ 63 ZIO_STAGE_DVA_CLAIM = 1 << 14, /* ---C- */ | 124 ZIO_STAGE_GANG_ASSEMBLE = 1 << 11, /* RWFC- */ 125 ZIO_STAGE_GANG_ISSUE = 1 << 12, /* RWFC- */ |
64 | 126 |
65 ZIO_STAGE_READY = 1 << 15, /* RWFCI */ | 127 ZIO_STAGE_DVA_ALLOCATE = 1 << 13, /* -W--- */ 128 ZIO_STAGE_DVA_FREE = 1 << 14, /* --F-- */ 129 ZIO_STAGE_DVA_CLAIM = 1 << 15, /* ---C- */ |
66 | 130 |
67 ZIO_STAGE_VDEV_IO_START = 1 << 16, /* RWF-I */ 68 ZIO_STAGE_VDEV_IO_DONE = 1 << 17, /* RWF-- */ 69 ZIO_STAGE_VDEV_IO_ASSESS = 1 << 18, /* RWF-I */ | 131 ZIO_STAGE_READY = 1 << 16, /* RWFCI */ |
70 | 132 |
71 ZIO_STAGE_CHECKSUM_VERIFY = 1 << 19, /* R---- */ | 133 ZIO_STAGE_VDEV_IO_START = 1 << 17, /* RWF-I */ 134 ZIO_STAGE_VDEV_IO_DONE = 1 << 18, /* RWF-- */ 135 ZIO_STAGE_VDEV_IO_ASSESS = 1 << 19, /* RWF-I */ |
72 | 136 |
73 ZIO_STAGE_DONE = 1 << 20 /* RWFCI */ | 137 ZIO_STAGE_CHECKSUM_VERIFY = 1 << 20, /* R---- */ 138 139 ZIO_STAGE_DONE = 1 << 21 /* RWFCI */ |
74}; 75 76#define ZIO_INTERLOCK_STAGES \ 77 (ZIO_STAGE_READY | \ 78 ZIO_STAGE_DONE) 79 80#define ZIO_INTERLOCK_PIPELINE \ 81 ZIO_INTERLOCK_STAGES --- 101 unchanged lines hidden --- | 140}; 141 142#define ZIO_INTERLOCK_STAGES \ 143 (ZIO_STAGE_READY | \ 144 ZIO_STAGE_DONE) 145 146#define ZIO_INTERLOCK_PIPELINE \ 147 ZIO_INTERLOCK_STAGES --- 101 unchanged lines hidden --- |