pnfs-obj: Better IO pattern in case of unaligned offset
authorBoaz Harrosh <bharrosh@panasas.com>
Thu, 2 Aug 2012 12:38:23 +0000 (15:38 +0300)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 2 Aug 2012 21:42:51 +0000 (17:42 -0400)
commit7de6e28417c65919cf2c1621841a650c4a3afbbd
tree2dce28c9c8163082ce111e42ff902879ddb8a53c
parentf6166384095b7ecf77752b5e9096e6d03d75f7ae
pnfs-obj: Better IO pattern in case of unaligned offset

Depending on layout and ARCH, ORE has some limits on max IO sizes
which is communicated on (what else) ore_layout->max_io_length,
which is always stripe aligned.
This was considered as the pg_test boundary for splitting and starting
a new IO.

But in the case of a long IO where the start offset is not aligned
what would happen is that both end of IO[N] and start of IO[N+1]
would be unaligned, causing each IO boundary parity unit to be
calculated and written twice.

So what we do in this patch is split the very start of an unaligned
IO, up to a stripe boundary, and then next IO's can continue fully
aligned til the end.

We might be sacrificing the case where the full unaligned IO would
fit within a single max_io_length, but the sacrifice is well worth
the elimination of double calculation and parity units IO.
Actually the sacrificing is marginal and is almost unmeasurable.

TODO:
If we know the total expected linear segment that will
be received, at pg_init, we could use that information
in many places:
1. blocks-layout get_layout write segment size
2. Better mds-threshold
3. In above situation for a better clean split

I will do this in future submission.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/objlayout/objio_osd.c