aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 455768a3eb9e..77ee3c1ec1a7 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -371,12 +371,14 @@ void blkiocg_update_io_remove_stats(struct blkio_group *blkg,
371} 371}
372EXPORT_SYMBOL_GPL(blkiocg_update_io_remove_stats); 372EXPORT_SYMBOL_GPL(blkiocg_update_io_remove_stats);
373 373
374void blkiocg_update_timeslice_used(struct blkio_group *blkg, unsigned long time) 374void blkiocg_update_timeslice_used(struct blkio_group *blkg, unsigned long time,
375 unsigned long unaccounted_time)
375{ 376{
376 unsigned long flags; 377 unsigned long flags;
377 378
378 spin_lock_irqsave(&blkg->stats_lock, flags); 379 spin_lock_irqsave(&blkg->stats_lock, flags);
379 blkg->stats.time += time; 380 blkg->stats.time += time;
381 blkg->stats.unaccounted_time += unaccounted_time;
380 spin_unlock_irqrestore(&blkg->stats_lock, flags); 382 spin_unlock_irqrestore(&blkg->stats_lock, flags);
381} 383}
382EXPORT_SYMBOL_GPL(blkiocg_update_timeslice_used); 384EXPORT_SYMBOL_GPL(blkiocg_update_timeslice_used);
@@ -603,6 +605,9 @@ static uint64_t blkio_get_stat(struct blkio_group *blkg,
603 if (type == BLKIO_STAT_SECTORS) 605 if (type == BLKIO_STAT_SECTORS)
604 return blkio_fill_stat(key_str, MAX_KEY_LEN - 1, 606 return blkio_fill_stat(key_str, MAX_KEY_LEN - 1,
605 blkg->stats.sectors, cb, dev); 607 blkg->stats.sectors, cb, dev);
608 if (type == BLKIO_STAT_UNACCOUNTED_TIME)
609 return blkio_fill_stat(key_str, MAX_KEY_LEN - 1,
610 blkg->stats.unaccounted_time, cb, dev);
606#ifdef CONFIG_DEBUG_BLK_CGROUP 611#ifdef CONFIG_DEBUG_BLK_CGROUP
607 if (type == BLKIO_STAT_AVG_QUEUE_SIZE) { 612 if (type == BLKIO_STAT_AVG_QUEUE_SIZE) {
608 uint64_t sum = blkg->stats.avg_queue_size_sum; 613 uint64_t sum = blkg->stats.avg_queue_size_sum;
@@ -1106,6 +1111,9 @@ static int blkiocg_file_read_map(struct cgroup *cgrp, struct cftype *cft,
1106 case BLKIO_PROP_sectors: 1111 case BLKIO_PROP_sectors:
1107 return blkio_read_blkg_stats(blkcg, cft, cb, 1112 return blkio_read_blkg_stats(blkcg, cft, cb,
1108 BLKIO_STAT_SECTORS, 0); 1113 BLKIO_STAT_SECTORS, 0);
1114 case BLKIO_PROP_unaccounted_time:
1115 return blkio_read_blkg_stats(blkcg, cft, cb,
1116 BLKIO_STAT_UNACCOUNTED_TIME, 0);
1109 case BLKIO_PROP_io_service_bytes: 1117 case BLKIO_PROP_io_service_bytes:
1110 return blkio_read_blkg_stats(blkcg, cft, cb, 1118 return blkio_read_blkg_stats(blkcg, cft, cb,
1111 BLKIO_STAT_SERVICE_BYTES, 1); 1119 BLKIO_STAT_SERVICE_BYTES, 1);
@@ -1262,6 +1270,12 @@ struct cftype blkio_files[] = {
1262 .read_map = blkiocg_file_read_map, 1270 .read_map = blkiocg_file_read_map,
1263 }, 1271 },
1264 { 1272 {
1273 .name = "unaccounted_time",
1274 .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP,
1275 BLKIO_PROP_unaccounted_time),
1276 .read_map = blkiocg_file_read_map,
1277 },
1278 {
1265 .name = "io_service_bytes", 1279 .name = "io_service_bytes",
1266 .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP, 1280 .private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP,
1267 BLKIO_PROP_io_service_bytes), 1281 BLKIO_PROP_io_service_bytes),