Skip to content

Commit

Permalink
block: enable zeroing of io_poll statistics
Browse files Browse the repository at this point in the history
Allow the io_poll statistics to be zeroed to make for easier logging
of polling event.

Signed-off-by: Stephen Bates <sbates@raithlin.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
sbates130272 authored and axboe committed Sep 14, 2016
1 parent 6e21935 commit d21ea4b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion block/blk-mq-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ static ssize_t blk_mq_hw_sysfs_poll_show(struct blk_mq_hw_ctx *hctx, char *page)
hctx->poll_success);
}

static ssize_t blk_mq_hw_sysfs_poll_store(struct blk_mq_hw_ctx *hctx,
const char *page, size_t size)
{
hctx->poll_considered = hctx->poll_invoked = hctx->poll_success = 0;

return size;
}

static ssize_t blk_mq_hw_sysfs_queued_show(struct blk_mq_hw_ctx *hctx,
char *page)
{
Expand Down Expand Up @@ -303,8 +311,9 @@ static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_cpus = {
.show = blk_mq_hw_sysfs_cpus_show,
};
static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_poll = {
.attr = {.name = "io_poll", .mode = S_IRUGO },
.attr = {.name = "io_poll", .mode = S_IWUSR | S_IRUGO },
.show = blk_mq_hw_sysfs_poll_show,
.store = blk_mq_hw_sysfs_poll_store,
};

static struct attribute *default_hw_ctx_attrs[] = {
Expand Down

0 comments on commit d21ea4b

Please sign in to comment.