Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: cciss: Make cciss_seq_show handle holes in the h->drv[] array cfq-iosched: split seeky coop queues after one slice
···4242 */4343#define CFQ_MIN_TT (2)44444545-/*4646- * Allow merged cfqqs to perform this amount of seeky I/O before4747- * deciding to break the queues up again.4848- */4949-#define CFQQ_COOP_TOUT (HZ)5050-5145#define CFQ_SLICE_SCALE (5)5246#define CFQ_HW_QUEUE_MIN (5)5347#define CFQ_SERVICE_SHIFT 124848+4949+#define CFQQ_SEEK_THR 8 * 10245050+#define CFQQ_SEEKY(cfqq) ((cfqq)->seek_mean > CFQQ_SEEK_THR)54515552#define RQ_CIC(rq) \5653 ((struct cfq_io_context *) (rq)->elevator_private)···134137 u64 seek_total;135138 sector_t seek_mean;136139 sector_t last_request_pos;137137- unsigned long seeky_start;138140139141 pid_t pid;140142···310314 CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */311315 CFQ_CFQQ_FLAG_sync, /* synchronous queue */312316 CFQ_CFQQ_FLAG_coop, /* cfqq is shared */317317+ CFQ_CFQQ_FLAG_split_coop, /* shared cfqq will be splitted */313318 CFQ_CFQQ_FLAG_deep, /* sync cfqq experienced large depth */314319 CFQ_CFQQ_FLAG_wait_busy, /* Waiting for next request */315320};···339342CFQ_CFQQ_FNS(slice_new);340343CFQ_CFQQ_FNS(sync);341344CFQ_CFQQ_FNS(coop);345345+CFQ_CFQQ_FNS(split_coop);342346CFQ_CFQQ_FNS(deep);343347CFQ_CFQQ_FNS(wait_busy);344348#undef CFQ_CFQQ_FNS···15641566 cfq_clear_cfqq_wait_busy(cfqq);1565156715661568 /*15691569+ * If this cfqq is shared between multiple processes, check to15701570+ * make sure that those processes are still issuing I/Os within15711571+ * the mean seek distance. If not, it may be time to break the15721572+ * queues apart again.15731573+ */15741574+ if (cfq_cfqq_coop(cfqq) && CFQQ_SEEKY(cfqq))15751575+ cfq_mark_cfqq_split_coop(cfqq);15761576+15771577+ /*15671578 * store what was left of this slice, if the queue idled/timed out15681579 */15691580 if (timed_out && !cfq_cfqq_slice_new(cfqq)) {···16691662 else16701663 return cfqd->last_position - blk_rq_pos(rq);16711664}16721672-16731673-#define CFQQ_SEEK_THR 8 * 102416741674-#define CFQQ_SEEKY(cfqq) ((cfqq)->seek_mean > CFQQ_SEEK_THR)1675166516761666static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq,16771667 struct request *rq, bool for_preempt)···30043000 total = cfqq->seek_total + (cfqq->seek_samples/2);30053001 do_div(total, cfqq->seek_samples);30063002 cfqq->seek_mean = (sector_t)total;30073007-30083008- /*30093009- * If this cfqq is shared between multiple processes, check to30103010- * make sure that those processes are still issuing I/Os within30113011- * the mean seek distance. If not, it may be time to break the30123012- * queues apart again.30133013- */30143014- if (cfq_cfqq_coop(cfqq)) {30153015- if (CFQQ_SEEKY(cfqq) && !cfqq->seeky_start)30163016- cfqq->seeky_start = jiffies;30173017- else if (!CFQQ_SEEKY(cfqq))30183018- cfqq->seeky_start = 0;30193019- }30203003}3021300430223005/*···34443453 return cic_to_cfqq(cic, 1);34453454}3446345534473447-static int should_split_cfqq(struct cfq_queue *cfqq)34483448-{34493449- if (cfqq->seeky_start &&34503450- time_after(jiffies, cfqq->seeky_start + CFQQ_COOP_TOUT))34513451- return 1;34523452- return 0;34533453-}34543454-34553456/*34563457 * Returns NULL if a new cfqq should be allocated, or the old cfqq if this34573458 * was the last process referring to said cfqq.···34523469split_cfqq(struct cfq_io_context *cic, struct cfq_queue *cfqq)34533470{34543471 if (cfqq_process_refs(cfqq) == 1) {34553455- cfqq->seeky_start = 0;34563472 cfqq->pid = current->pid;34573473 cfq_clear_cfqq_coop(cfqq);34743474+ cfq_clear_cfqq_split_coop(cfqq);34583475 return cfqq;34593476 }34603477···34933510 /*34943511 * If the queue was seeky for too long, break it apart.34953512 */34963496- if (cfq_cfqq_coop(cfqq) && should_split_cfqq(cfqq)) {35133513+ if (cfq_cfqq_coop(cfqq) && cfq_cfqq_split_coop(cfqq)) {34973514 cfq_log_cfqq(cfqd, cfqq, "breaking apart cfqq");34983515 cfqq = split_cfqq(cic, cfqq);34993516 if (!cfqq)
+3
drivers/block/cciss.c
···337337 if (*pos > h->highest_lun)338338 return 0;339339340340+ if (drv == NULL) /* it's possible for h->drv[] to have holes. */341341+ return 0;342342+340343 if (drv->heads == 0)341344 return 0;342345