|
Lines 792-797
Link Here
|
| 792 |
__cfq_set_active_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) |
792 |
__cfq_set_active_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) |
| 793 |
{ |
793 |
{ |
| 794 |
if (cfqq) { |
794 |
if (cfqq) { |
|
|
795 |
WARN_ON(RB_EMPTY(&cfqq->sort_list)); |
| 796 |
|
| 795 |
/* |
797 |
/* |
| 796 |
* stop potential idle class queues waiting service |
798 |
* stop potential idle class queues waiting service |
| 797 |
*/ |
799 |
*/ |
|
Lines 882-889
Link Here
|
| 882 |
* if current list is non-empty, grab first entry. if it is empty, |
884 |
* if current list is non-empty, grab first entry. if it is empty, |
| 883 |
* get next prio level and grab first entry then if any are spliced |
885 |
* get next prio level and grab first entry then if any are spliced |
| 884 |
*/ |
886 |
*/ |
| 885 |
if (!list_empty(&cfqd->cur_rr) || cfq_get_next_prio_level(cfqd) != -1) |
887 |
if (!list_empty(&cfqd->cur_rr) || cfq_get_next_prio_level(cfqd) != -1) { |
| 886 |
cfqq = list_entry_cfqq(cfqd->cur_rr.next); |
888 |
cfqq = list_entry_cfqq(cfqd->cur_rr.next); |
|
|
889 |
WARN_ON(RB_EMPTY(&cfqq->sort_list)); |
| 890 |
} |
| 887 |
|
891 |
|
| 888 |
/* |
892 |
/* |
| 889 |
* if we have idle queues and no rt or be queues had pending |
893 |
* if we have idle queues and no rt or be queues had pending |
|
Lines 893-901
Link Here
|
| 893 |
if (!cfqq && !list_empty(&cfqd->idle_rr)) { |
897 |
if (!cfqq && !list_empty(&cfqd->idle_rr)) { |
| 894 |
unsigned long end = cfqd->last_end_request + CFQ_IDLE_GRACE; |
898 |
unsigned long end = cfqd->last_end_request + CFQ_IDLE_GRACE; |
| 895 |
|
899 |
|
| 896 |
if (time_after_eq(jiffies, end)) |
900 |
if (time_after_eq(jiffies, end)) { |
| 897 |
cfqq = list_entry_cfqq(cfqd->idle_rr.next); |
901 |
cfqq = list_entry_cfqq(cfqd->idle_rr.next); |
| 898 |
else |
902 |
WARN_ON(RB_EMPTY(&cfqq->sort_list)); |
|
|
903 |
} else |
| 899 |
mod_timer(&cfqd->idle_class_timer, end); |
904 |
mod_timer(&cfqd->idle_class_timer, end); |
| 900 |
} |
905 |
} |
| 901 |
|
906 |
|
|
Lines 1145-1151
Link Here
|
| 1145 |
{ |
1150 |
{ |
| 1146 |
int dispatched = 0; |
1151 |
int dispatched = 0; |
| 1147 |
|
1152 |
|
| 1148 |
BUG_ON(RB_EMPTY(&cfqq->sort_list)); |
1153 |
if (RB_EMPTY(&cfqq->sort_list)) { |
|
|
1154 |
printk("rb empty on dispatch: q=%d/%d, a=%d/%d, d=%d/%d, rr=%d, f=%x, k=%d\n", cfqq->queued[0], cfqq->queued[1], cfqq->allocated[0], cfqq->allocated[1], cfqq->on_dispatch[0], cfqq->on_dispatch[1], list_empty(&cfqq->cfq_list), cfqq->flags, cfqq->key); |
| 1155 |
return 0; |
| 1156 |
} |
| 1149 |
|
1157 |
|
| 1150 |
do { |
1158 |
do { |
| 1151 |
struct cfq_rq *crq; |
1159 |
struct cfq_rq *crq; |