Skip to content
  • Boaz Harrosh's avatar
    pnfs-obj: Better IO pattern in case of unaligned offset · 7de6e284
    Boaz Harrosh authored
    
    
    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: default avatarBoaz Harrosh <bharrosh@panasas.com>
    Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
    7de6e284