stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] blk-iolatency: clear use_delay when io.latency is set to zero
       [not found] <20190613223041.606735-1-tj@kernel.org>
@ 2019-06-13 22:30 ` Tejun Heo
  2019-06-13 22:30 ` [PATCH 2/5] blkcg: update blkcg_print_stat() to handle larger outputs Tejun Heo
  1 sibling, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2019-06-13 22:30 UTC (permalink / raw)
  To: axboe, jbacik
  Cc: linux-kernel, linux-block, kernel-team, dennis, jack, Tejun Heo,
	stable

If use_delay was non-zero when the latency target of a cgroup was set
to zero, it will stay stuck until io.latency is enabled on the cgroup
again.  This keeps readahead disabled for the cgroup impacting
performance negatively.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Josef Bacik <jbacik@fb.com>
Fixes: d70675121546 ("block: introduce blk-iolatency io controller")
Cc: stable@vger.kernel.org # v4.19+
---
 block/blk-iolatency.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
index d22e61bced86..17896bb3aaf2 100644
--- a/block/blk-iolatency.c
+++ b/block/blk-iolatency.c
@@ -778,8 +778,10 @@ static int iolatency_set_min_lat_nsec(struct blkcg_gq *blkg, u64 val)
 
 	if (!oldval && val)
 		return 1;
-	if (oldval && !val)
+	if (oldval && !val) {
+		blkcg_clear_delay(blkg);
 		return -1;
+	}
 	return 0;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/5] blkcg: update blkcg_print_stat() to handle larger outputs
       [not found] <20190613223041.606735-1-tj@kernel.org>
  2019-06-13 22:30 ` [PATCH 1/5] blk-iolatency: clear use_delay when io.latency is set to zero Tejun Heo
@ 2019-06-13 22:30 ` Tejun Heo
  1 sibling, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2019-06-13 22:30 UTC (permalink / raw)
  To: axboe, jbacik
  Cc: linux-kernel, linux-block, kernel-team, dennis, jack, Tejun Heo,
	stable

Depending on the number of devices, blkcg stats can go over the
default seqfile buf size.  seqfile normally retries with a larger
buffer but since the ->pd_stat() addition, blkcg_print_stat() doesn't
tell seqfile that overflow has happened and the output gets printed
truncated.  Fix it by calling seq_commit() w/ -1 on possible
overflows.

Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 903d23f0a354 ("blk-cgroup: allow controllers to output their own stats")
Cc: stable@vger.kernel.org # v4.19+
Cc: Josef Bacik <jbacik@fb.com>
---
 block/blk-cgroup.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 1f7127b03490..e4715b35d42c 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1006,8 +1006,12 @@ static int blkcg_print_stat(struct seq_file *sf, void *v)
 		}
 next:
 		if (has_stats) {
-			off += scnprintf(buf+off, size-off, "\n");
-			seq_commit(sf, off);
+			if (off < size - 1) {
+				off += scnprintf(buf+off, size-off, "\n");
+				seq_commit(sf, off);
+			} else {
+				seq_commit(sf, -1);
+			}
 		}
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-13 22:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20190613223041.606735-1-tj@kernel.org>
2019-06-13 22:30 ` [PATCH 1/5] blk-iolatency: clear use_delay when io.latency is set to zero Tejun Heo
2019-06-13 22:30 ` [PATCH 2/5] blkcg: update blkcg_print_stat() to handle larger outputs Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).