lkml.org 
[lkml]   [2020]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH block v2 2/3] block: Add support for REQ_NOZERO flag
    From
    Date

    Kirill,

    > + if (flags & BLKDEV_ZERO_NOUNMAP)
    > + req_flags |= REQ_NOUNMAP;
    > + if (flags & BLKDEV_ZERO_ALLOCATE)
    > + req_flags |= REQ_NOZERO|REQ_NOUNMAP;

    I find there is some dissonance between using BLKDEV_ZERO_ALLOCATE to
    describe this operation in one case and REQ_NOZERO in the other.

    I understand why not zeroing is important in your case. However, I think
    the allocation aspect is semantically more important. Also, in the case
    of SCSI, the allocated blocks will typically appear zeroed. So from that
    perspective REQ_NOZERO doesn't really make sense. I would really prefer
    to use REQ_ALLOCATE to describe this operation. I agree that "do not
    write every block" is important too. I just don't have a good suggestion
    for how to express that as an additional qualifier to REQ_ALLOCATE_?.

    Also, adding to the confusion: In the context of SCSI, ANCHOR requires
    UNMAP. So my head hurts a bit when I read REQ_NOZERO|REQ_NOUNMAP and
    have to translate that into ANCHOR|UNMAP.

    Longer term, I think we should consider introducing REQ_OP_SINGLE_RANGE
    or something like that as an umbrella operation that can be used to
    describe zeroing, allocating, and other things that operate on a single
    LBA range with no payload. Thus removing both the writiness and the
    zeroness from the existing REQ_OP_WRITE_ZEROES conduit.

    Naming issues aside, your patch looks fine. I'll try to rebase my SCSI
    patches on top of your series to see how things fit.

    --
    Martin K. Petersen Oracle Linux Engineering

    \
     
     \ /
      Last update: 2020-01-21 07:15    [W:3.880 / U:0.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site