diff options
author | jxiong <[email protected]> | 2017-05-02 10:04:30 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-05-02 10:04:30 -0700 |
commit | 24fa20340dda244270a1382bfdb8d94f579ae7df (patch) | |
tree | b722267bf0a44ca9fa97db8444f6e7ef8603b79a | |
parent | 7dae2c81e7b2e68a596c5b431444be0fae308156 (diff) |
Guarantee PAGESIZE alignment for large zio buffers
In current implementation, only zio buffers in 16KB and bigger are
guaranteed PAGESIZE alignment. This breaks Lustre since it assumes
that 'arc_buf_t::b_data' must be page aligned when zio buffers are
greater than or equal to PAGESIZE.
This patch will make the zio buffers to be PAGESIZE aligned when
the sizes are not less than PAGESIZE.
This change may cause a little bit memory waste but that should be
fine because after ABD is introduced, zio buffers are used to hold
data temporarily and live in memory for a short while.
Reviewed-by: Don Brady <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jinshan Xiong <[email protected]>
Signed-off-by: Jinshan Xiong <[email protected]>
Closes #6084
-rw-r--r-- | module/zfs/zio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/zio.c b/module/zfs/zio.c index d0466709b..61eb575ef 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -167,10 +167,10 @@ zio_init(void) */ align = 8 * SPA_MINBLOCKSIZE; #else - if (size <= 4 * SPA_MINBLOCKSIZE) { + if (size < PAGESIZE) { align = SPA_MINBLOCKSIZE; } else if (IS_P2ALIGNED(size, p2 >> 2)) { - align = MIN(p2 >> 2, PAGESIZE); + align = PAGESIZE; } #endif |