Skip to content

Commit 28baf44

Browse files
Divyesh ShahJens Axboe
authored andcommitted
blkio: Fix compile errors
Fixes compile errors in blk-cgroup code for empty_time stat and a merge fix in CFQ. The first error was when CONFIG_DEBUG_CFQ_IOSCHED is not set. Signed-off-by: Divyesh Shah <dpshah@google.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent 4facdae commit 28baf44

2 files changed

Lines changed: 28 additions & 28 deletions

File tree

‎block/blk-cgroup.c‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,33 @@ void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg)
219219
}
220220
EXPORT_SYMBOL_GPL(blkiocg_update_avg_queue_size_stats);
221221

222+
void blkiocg_set_start_empty_time(struct blkio_group *blkg, bool ignore)
223+
{
224+
unsigned long flags;
225+
struct blkio_group_stats *stats;
226+
227+
spin_lock_irqsave(&blkg->stats_lock, flags);
228+
stats = &blkg->stats;
229+
230+
if (stats->stat_arr[BLKIO_STAT_QUEUED][BLKIO_STAT_READ] ||
231+
stats->stat_arr[BLKIO_STAT_QUEUED][BLKIO_STAT_WRITE]) {
232+
spin_unlock_irqrestore(&blkg->stats_lock, flags);
233+
return;
234+
}
235+
236+
/*
237+
* If ignore is set, we do not panic on the empty flag being set
238+
* already. This is to avoid cases where there are superfluous timeslice
239+
* complete events (for eg., forced_dispatch in CFQ) when no IOs are
240+
* served which could result in triggering the empty check incorrectly.
241+
*/
242+
BUG_ON(!ignore && blkio_blkg_empty(stats));
243+
stats->start_empty_time = sched_clock();
244+
blkio_mark_blkg_empty(stats);
245+
spin_unlock_irqrestore(&blkg->stats_lock, flags);
246+
}
247+
EXPORT_SYMBOL_GPL(blkiocg_set_start_empty_time);
248+
222249
void blkiocg_update_dequeue_stats(struct blkio_group *blkg,
223250
unsigned long dequeue)
224251
{
@@ -268,33 +295,6 @@ void blkiocg_update_timeslice_used(struct blkio_group *blkg, unsigned long time)
268295
}
269296
EXPORT_SYMBOL_GPL(blkiocg_update_timeslice_used);
270297

271-
void blkiocg_set_start_empty_time(struct blkio_group *blkg, bool ignore)
272-
{
273-
unsigned long flags;
274-
struct blkio_group_stats *stats;
275-
276-
spin_lock_irqsave(&blkg->stats_lock, flags);
277-
stats = &blkg->stats;
278-
279-
if (stats->stat_arr[BLKIO_STAT_QUEUED][BLKIO_STAT_READ] ||
280-
stats->stat_arr[BLKIO_STAT_QUEUED][BLKIO_STAT_WRITE]) {
281-
spin_unlock_irqrestore(&blkg->stats_lock, flags);
282-
return;
283-
}
284-
285-
/*
286-
* If ignore is set, we do not panic on the empty flag being set
287-
* already. This is to avoid cases where there are superfluous timeslice
288-
* complete events (for eg., forced_dispatch in CFQ) when no IOs are
289-
* served which could result in triggering the empty check incorrectly.
290-
*/
291-
BUG_ON(!ignore && blkio_blkg_empty(stats));
292-
stats->start_empty_time = sched_clock();
293-
blkio_mark_blkg_empty(stats);
294-
spin_unlock_irqrestore(&blkg->stats_lock, flags);
295-
}
296-
EXPORT_SYMBOL_GPL(blkiocg_set_start_empty_time);
297-
298298
void blkiocg_update_dispatch_stats(struct blkio_group *blkg,
299299
uint64_t bytes, bool direction, bool sync)
300300
{

‎block/cfq-iosched.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ static int cfq_forced_dispatch(struct cfq_data *cfqd)
22312231
int dispatched = 0;
22322232

22332233
/* Expire the timeslice of the current active queue first */
2234-
cfq_slice_expired(cfqd, 0);
2234+
cfq_slice_expired(cfqd, 0, true);
22352235
while ((cfqq = cfq_get_next_queue_forced(cfqd)) != NULL) {
22362236
__cfq_set_active_queue(cfqd, cfqq);
22372237
dispatched += __cfq_forced_dispatch_cfqq(cfqq);

0 commit comments

Comments
 (0)