16 Jun, 2018

1 commit

  • commit 327ea4adcfa37194739f1ec7c70568944d292281 upstream.

    Avoid that complaints similar to the following appear in the kernel log
    if the number of zones is sufficiently large:

    fio: page allocation failure: order:9, mode:0x140c0c0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null)
    Call Trace:
    dump_stack+0x63/0x88
    warn_alloc+0xf5/0x190
    __alloc_pages_slowpath+0x8f0/0xb0d
    __alloc_pages_nodemask+0x242/0x260
    alloc_pages_current+0x6a/0xb0
    kmalloc_order+0x18/0x50
    kmalloc_order_trace+0x26/0xb0
    __kmalloc+0x20e/0x220
    blkdev_report_zones_ioctl+0xa5/0x1a0
    blkdev_ioctl+0x1ba/0x930
    block_ioctl+0x41/0x50
    do_vfs_ioctl+0xaa/0x610
    SyS_ioctl+0x79/0x90
    do_syscall_64+0x79/0x1b0
    entry_SYSCALL_64_after_hwframe+0x3d/0xa2

    Fixes: 3ed05a987e0f ("blk-zoned: implement ioctls")
    Signed-off-by: Bart Van Assche
    Cc: Shaun Tancheff
    Cc: Damien Le Moal
    Cc: Christoph Hellwig
    Cc: Martin K. Petersen
    Cc: Hannes Reinecke
    Cc:
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Bart Van Assche
     

24 Aug, 2017

1 commit

  • This way we don't need a block_device structure to submit I/O. The
    block_device has different life time rules from the gendisk and
    request_queue and is usually only available when the block device node
    is open. Other callers need to explicitly create one (e.g. the lightnvm
    passthrough code, or the new nvme multipathing code).

    For the actual I/O path all that we need is the gendisk, which exists
    once per block device. But given that the block layer also does
    partition remapping we additionally need a partition index, which is
    used for said remapping in generic_make_request.

    Note that all the block drivers generally want request_queue or
    sometimes the gendisk, so this removes a layer of indirection all
    over the stack.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

12 Jan, 2017

1 commit

  • All block device data fields and functions returning a number of 512B
    sectors are by convention named xxx_sectors while names in the form
    xxx_size are generally used for a number of bytes. The blk_queue_zone_size
    and bdev_zone_size functions were not following this convention so rename
    them.

    No functional change is introduced by this patch.

    Signed-off-by: Damien Le Moal

    Collapsed the two patches, they were nonsensically split and broke
    bisection.

    Signed-off-by: Jens Axboe

    Damien Le Moal
     

25 Oct, 2016

1 commit

  • The blkdev_report_zones produces a harmless warning when
    -Wmaybe-uninitialized is set, after gcc gets a little confused
    about the multiple 'goto' here:

    block/blk-zoned.c: In function 'blkdev_report_zones':
    block/blk-zoned.c:188:13: error: 'nz' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    Moving the assignment to nr_zones makes this a little simpler
    while also avoiding the warning reliably. I'm removing the
    extraneous initialization of 'int ret' in the same patch, as
    that is semi-related and could cause an uninitialized use of
    that variable to not produce a warning.

    Fixes: 6a0cb1bc106f ("block: Implement support for zoned block devices")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Shaun Tancheff
    Reviewed-by: Damien Le Moal
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     

19 Oct, 2016

2 commits

  • Adds the new BLKREPORTZONE and BLKRESETZONE ioctls for respectively
    obtaining the zone configuration of a zoned block device and resetting
    the write pointer of sequential zones of a zoned block device.

    The BLKREPORTZONE ioctl maps directly to a single call of the function
    blkdev_report_zones. The zone information result is passed as an array
    of struct blk_zone identical to the structure used internally for
    processing the REQ_OP_ZONE_REPORT operation. The BLKRESETZONE ioctl
    maps to a single call of the blkdev_reset_zones function.

    Signed-off-by: Shaun Tancheff
    Signed-off-by: Damien Le Moal
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Shaun Tancheff
     
  • Implement zoned block device zone information reporting and reset.
    Zone information are reported as struct blk_zone. This implementation
    does not differentiate between host-aware and host-managed device
    models and is valid for both. Two functions are provided:
    blkdev_report_zones for discovering the zone configuration of a
    zoned block device, and blkdev_reset_zones for resetting the write
    pointer of sequential zones. The helper function blk_queue_zone_size
    and bdev_zone_size are also provided for, as the name suggest,
    obtaining the zone size (in 512B sectors) of the zones of the device.

    Signed-off-by: Hannes Reinecke

    [Damien: * Removed the zone cache
    * Implement report zones operation based on earlier proposal
    by Shaun Tancheff ]
    Signed-off-by: Damien Le Moal
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Shaun Tancheff
    Tested-by: Shaun Tancheff
    Signed-off-by: Jens Axboe

    Hannes Reinecke