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.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 83930f65016a..af42efbb0c1d 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -213,7 +213,7 @@ void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg)
213} 213}
214EXPORT_SYMBOL_GPL(blkiocg_update_avg_queue_size_stats); 214EXPORT_SYMBOL_GPL(blkiocg_update_avg_queue_size_stats);
215 215
216void blkiocg_set_start_empty_time(struct blkio_group *blkg, bool ignore) 216void blkiocg_set_start_empty_time(struct blkio_group *blkg)
217{ 217{
218 unsigned long flags; 218 unsigned long flags;
219 struct blkio_group_stats *stats; 219 struct blkio_group_stats *stats;
@@ -228,12 +228,15 @@ void blkiocg_set_start_empty_time(struct blkio_group *blkg, bool ignore)
228 } 228 }
229 229
230 /* 230 /*
231 * If ignore is set, we do not panic on the empty flag being set 231 * group is already marked empty. This can happen if cfqq got new
232 * already. This is to avoid cases where there are superfluous timeslice 232 * request in parent group and moved to this group while being added
233 * complete events (for eg., forced_dispatch in CFQ) when no IOs are 233 * to service tree. Just ignore the event and move on.
234 * served which could result in triggering the empty check incorrectly.
235 */ 234 */
236 BUG_ON(!ignore && blkio_blkg_empty(stats)); 235 if(blkio_blkg_empty(stats)) {
236 spin_unlock_irqrestore(&blkg->stats_lock, flags);
237 return;
238 }
239
237 stats->start_empty_time = sched_clock(); 240 stats->start_empty_time = sched_clock();
238 blkio_mark_blkg_empty(stats); 241 blkio_mark_blkg_empty(stats);
239 spin_unlock_irqrestore(&blkg->stats_lock, flags); 242 spin_unlock_irqrestore(&blkg->stats_lock, flags);