static void row_restart_cycle(struct row_data *rd, int start_idx, int end_idx) { int i; row_dump_queues_stat(rd); for (i = start_idx; i < end_idx; i++) { if (rd->row_queues[i].nr_dispatched < rd->row_queues[i].disp_quantum) row_mark_rowq_unserved(rd, i); rd->row_queues[i].nr_dispatched = 0; } row_log(rd->dispatch_queue, "Restarting cycle for class @ %d-%d", start_idx, end_idx); }
/* * row_choose_queue() - choose the next queue to dispatch from * @rd: pointer to struct row_data * * Updates rd->curr_queue. Returns 1 if there are requests to * dispatch, 0 if there are no requests in scheduler * */ static int row_choose_queue(struct row_data *rd) { int prev_curr_queue = rd->curr_queue; if (!(rd->nr_reqs[0] + rd->nr_reqs[1])) return 0; row_get_next_queue(rd); /* * Loop over all queues to find the next queue that is not empty. * Stop when you get back to curr_queue */ while (list_empty(&rd->row_queues[rd->curr_queue].rqueue.fifo) && rd->curr_queue != prev_curr_queue) { /* Mark rqueue as unserved */ row_mark_rowq_unserved(rd, rd->curr_queue); row_get_next_queue(rd); } return 1; }