Skip to content

Commit

Permalink
Merge tag 'block-5.10-2020-10-12' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
Pull block updates from Jens Axboe:

 - Series of merge handling cleanups (Baolin, Christoph)

 - Series of blk-throttle fixes and cleanups (Baolin)

 - Series cleaning up BDI, seperating the block device from the
   backing_dev_info (Christoph)

 - Removal of bdget() as a generic API (Christoph)

 - Removal of blkdev_get() as a generic API (Christoph)

 - Cleanup of is-partition checks (Christoph)

 - Series reworking disk revalidation (Christoph)

 - Series cleaning up bio flags (Christoph)

 - bio crypt fixes (Eric)

 - IO stats inflight tweak (Gabriel)

 - blk-mq tags fixes (Hannes)

 - Buffer invalidation fixes (Jan)

 - Allow soft limits for zone append (Johannes)

 - Shared tag set improvements (John, Kashyap)

 - Allow IOPRIO_CLASS_RT for CAP_SYS_NICE (Khazhismel)

 - DM no-wait support (Mike, Konstantin)

 - Request allocation improvements (Ming)

 - Allow md/dm/bcache to use IO stat helpers (Song)

 - Series improving blk-iocost (Tejun)

 - Various cleanups (Geert, Damien, Danny, Julia, Tetsuo, Tian, Wang,
   Xianting, Yang, Yufen, yangerkun)

* tag 'block-5.10-2020-10-12' of git://git.kernel.dk/linux-block: (191 commits)
  block: fix uapi blkzoned.h comments
  blk-mq: move cancel of hctx->run_work to the front of blk_exit_queue
  blk-mq: get rid of the dead flush handle code path
  block: get rid of unnecessary local variable
  block: fix comment and add lockdep assert
  blk-mq: use helper function to test hw stopped
  block: use helper function to test queue register
  block: remove redundant mq check
  block: invoke blk_mq_exit_sched no matter whether have .exit_sched
  percpu_ref: don't refer to ref->data if it isn't allocated
  block: ratelimit handle_bad_sector() message
  blk-throttle: Re-use the throtl_set_slice_end()
  blk-throttle: Open code __throtl_de/enqueue_tg()
  blk-throttle: Move service tree validation out of the throtl_rb_first()
  blk-throttle: Move the list operation after list validation
  blk-throttle: Fix IO hang for a corner case
  blk-throttle: Avoid tracking latency if low limit is invalid
  blk-throttle: Avoid getting the current time if tg->last_finish_time is 0
  blk-throttle: Remove a meaningless parameter for throtl_downgrade_state()
  block: Remove redundant 'return' statement
  ...
  • Loading branch information
torvalds committed Oct 13, 2020
2 parents 857d644 + 8858e8d commit 3ad11d7
Show file tree
Hide file tree
Showing 144 changed files with 3,229 additions and 2,446 deletions.
3 changes: 0 additions & 3 deletions Documentation/filesystems/locking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,6 @@ getgeo: no
swap_slot_free_notify: no (see below)
======================= ===================

unlock_native_capacity and revalidate_disk are called only from
check_disk_change().

swap_slot_free_notify is called with swap_lock and sometimes the page lock
held.

Expand Down
24 changes: 12 additions & 12 deletions Documentation/userspace-api/ioctl/hdio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ HDIO_SET_UNMASKINTR


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 1]
- EBUSY Controller busy
Expand Down Expand Up @@ -231,7 +231,7 @@ HDIO_SET_MULTCOUNT


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range supported by disk.
- EBUSY Controller busy or blockmode already set.
Expand Down Expand Up @@ -295,7 +295,7 @@ HDIO_GET_IDENTITY
the ATA specification.

error returns:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- ENOMSG IDENTIFY DEVICE information not available

notes:
Expand Down Expand Up @@ -355,7 +355,7 @@ HDIO_SET_KEEPSETTINGS


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 1]
- EBUSY Controller busy
Expand Down Expand Up @@ -1055,7 +1055,7 @@ HDIO_SET_32BIT


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 3]
- EBUSY Controller busy
Expand Down Expand Up @@ -1085,7 +1085,7 @@ HDIO_SET_NOWERR


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 1]
- EBUSY Controller busy
Expand Down Expand Up @@ -1113,7 +1113,7 @@ HDIO_SET_DMA


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 1]
- EBUSY Controller busy
Expand Down Expand Up @@ -1141,7 +1141,7 @@ HDIO_SET_PIO_MODE


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 255]
- EBUSY Controller busy
Expand Down Expand Up @@ -1237,7 +1237,7 @@ HDIO_SET_WCACHE


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 1]
- EBUSY Controller busy
Expand Down Expand Up @@ -1265,7 +1265,7 @@ HDIO_SET_ACOUSTIC


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 254]
- EBUSY Controller busy
Expand Down Expand Up @@ -1305,7 +1305,7 @@ HDIO_SET_ADDRESS


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 2]
- EBUSY Controller busy
Expand All @@ -1331,7 +1331,7 @@ HDIO_SET_IDE_SCSI


error return:
- EINVAL (bdev != bdev->bd_contains) (not sure what this means)
- EINVAL Called on a partition instead of the whole disk device
- EACCES Access denied: requires CAP_SYS_ADMIN
- EINVAL value out of range [0 1]
- EBUSY Controller busy
Expand Down
2 changes: 0 additions & 2 deletions block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ config BLK_WBT_MQ
depends on BLK_WBT
help
Enable writeback throttling by default on multiqueue devices.
Multiqueue currently doesn't have support for IO scheduling,
enabling this option is recommended.

config BLK_DEBUG_FS
bool "Block layer debugging information in debugfs"
Expand Down
9 changes: 7 additions & 2 deletions block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4640,6 +4640,9 @@ static bool bfq_has_work(struct blk_mq_hw_ctx *hctx)
{
struct bfq_data *bfqd = hctx->queue->elevator->elevator_data;

if (!atomic_read(&hctx->elevator_queued))
return false;

/*
* Avoiding lock: a race on bfqd->busy_queues should cause at
* most a call to dispatch for nothing
Expand Down Expand Up @@ -5554,6 +5557,7 @@ static void bfq_insert_requests(struct blk_mq_hw_ctx *hctx,
rq = list_first_entry(list, struct request, queuelist);
list_del_init(&rq->queuelist);
bfq_insert_request(hctx, rq, at_head);
atomic_inc(&hctx->elevator_queued);
}
}

Expand Down Expand Up @@ -5921,6 +5925,7 @@ static void bfq_finish_requeue_request(struct request *rq)

bfq_completed_request(bfqq, bfqd);
bfq_finish_requeue_request_body(bfqq);
atomic_dec(&rq->mq_hctx->elevator_queued);

spin_unlock_irqrestore(&bfqd->lock, flags);
} else {
Expand Down Expand Up @@ -6360,8 +6365,8 @@ static void bfq_depth_updated(struct blk_mq_hw_ctx *hctx)
struct blk_mq_tags *tags = hctx->sched_tags;
unsigned int min_shallow;

min_shallow = bfq_update_depths(bfqd, &tags->bitmap_tags);
sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, min_shallow);
min_shallow = bfq_update_depths(bfqd, tags->bitmap_tags);
sbitmap_queue_min_shallow_depth(tags->bitmap_tags, min_shallow);
}

static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index)
Expand Down
20 changes: 9 additions & 11 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,20 +713,18 @@ struct bio *bio_clone_fast(struct bio *bio, gfp_t gfp_mask, struct bio_set *bs)

__bio_clone_fast(b, bio);

bio_crypt_clone(b, bio, gfp_mask);
if (bio_crypt_clone(b, bio, gfp_mask) < 0)
goto err_put;

if (bio_integrity(bio)) {
int ret;

ret = bio_integrity_clone(b, bio, gfp_mask);

if (ret < 0) {
bio_put(b);
return NULL;
}
}
if (bio_integrity(bio) &&
bio_integrity_clone(b, bio, gfp_mask) < 0)
goto err_put;

return b;

err_put:
bio_put(b);
return NULL;
}
EXPORT_SYMBOL(bio_clone_fast);

Expand Down
32 changes: 26 additions & 6 deletions block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,24 @@ static void blkg_async_bio_workfn(struct work_struct *work)
async_bio_work);
struct bio_list bios = BIO_EMPTY_LIST;
struct bio *bio;
struct blk_plug plug;
bool need_plug = false;

/* as long as there are pending bios, @blkg can't go away */
spin_lock_bh(&blkg->async_bio_lock);
bio_list_merge(&bios, &blkg->async_bios);
bio_list_init(&blkg->async_bios);
spin_unlock_bh(&blkg->async_bio_lock);

/* start plug only when bio_list contains at least 2 bios */
if (bios.head && bios.head->bi_next) {
need_plug = true;
blk_start_plug(&plug);
}
while ((bio = bio_list_pop(&bios)))
submit_bio(bio);
if (need_plug)
blk_finish_plug(&plug);
}

/**
Expand Down Expand Up @@ -1613,16 +1622,24 @@ static void blkcg_scale_delay(struct blkcg_gq *blkg, u64 now)
static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay)
{
unsigned long pflags;
bool clamp;
u64 now = ktime_to_ns(ktime_get());
u64 exp;
u64 delay_nsec = 0;
int tok;

while (blkg->parent) {
if (atomic_read(&blkg->use_delay)) {
int use_delay = atomic_read(&blkg->use_delay);

if (use_delay) {
u64 this_delay;

blkcg_scale_delay(blkg, now);
delay_nsec = max_t(u64, delay_nsec,
atomic64_read(&blkg->delay_nsec));
this_delay = atomic64_read(&blkg->delay_nsec);
if (this_delay > delay_nsec) {
delay_nsec = this_delay;
clamp = use_delay > 0;
}
}
blkg = blkg->parent;
}
Expand All @@ -1634,10 +1651,13 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay)
* Let's not sleep for all eternity if we've amassed a huge delay.
* Swapping or metadata IO can accumulate 10's of seconds worth of
* delay, and we want userspace to be able to do _something_ so cap the
* delays at 1 second. If there's 10's of seconds worth of delay then
* the tasks will be delayed for 1 second for every syscall.
* delays at 0.25s. If there's 10's of seconds worth of delay then the
* tasks will be delayed for 0.25 second for every syscall. If
* blkcg_set_delay() was used as indicated by negative use_delay, the
* caller is responsible for regulating the range.
*/
delay_nsec = min_t(u64, delay_nsec, 250 * NSEC_PER_MSEC);
if (clamp)
delay_nsec = min_t(u64, delay_nsec, 250 * NSEC_PER_MSEC);

if (use_memdelay)
psi_memstall_enter(&pflags);
Expand Down
Loading

0 comments on commit 3ad11d7

Please sign in to comment.