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
···42 */43#define CFQ_MIN_TT (2)4445-/*46- * Allow merged cfqqs to perform this amount of seeky I/O before47- * deciding to break the queues up again.48- */49-#define CFQQ_COOP_TOUT (HZ)50-51#define CFQ_SLICE_SCALE (5)52#define CFQ_HW_QUEUE_MIN (5)53#define CFQ_SERVICE_SHIFT 120005455#define RQ_CIC(rq) \56 ((struct cfq_io_context *) (rq)->elevator_private)···134 u64 seek_total;135 sector_t seek_mean;136 sector_t last_request_pos;137- unsigned long seeky_start;138139 pid_t pid;140···310 CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */311 CFQ_CFQQ_FLAG_sync, /* synchronous queue */312 CFQ_CFQQ_FLAG_coop, /* cfqq is shared */0313 CFQ_CFQQ_FLAG_deep, /* sync cfqq experienced large depth */314 CFQ_CFQQ_FLAG_wait_busy, /* Waiting for next request */315};···339CFQ_CFQQ_FNS(slice_new);340CFQ_CFQQ_FNS(sync);341CFQ_CFQQ_FNS(coop);0342CFQ_CFQQ_FNS(deep);343CFQ_CFQQ_FNS(wait_busy);344#undef CFQ_CFQQ_FNS···1564 cfq_clear_cfqq_wait_busy(cfqq);15651566 /*0000000001567 * store what was left of this slice, if the queue idled/timed out1568 */1569 if (timed_out && !cfq_cfqq_slice_new(cfqq)) {···1669 else1670 return cfqd->last_position - blk_rq_pos(rq);1671}1672-1673-#define CFQQ_SEEK_THR 8 * 10241674-#define CFQQ_SEEKY(cfqq) ((cfqq)->seek_mean > CFQQ_SEEK_THR)16751676static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq,1677 struct request *rq, bool for_preempt)···3004 total = cfqq->seek_total + (cfqq->seek_samples/2);3005 do_div(total, cfqq->seek_samples);3006 cfqq->seek_mean = (sector_t)total;3007-3008- /*3009- * If this cfqq is shared between multiple processes, check to3010- * make sure that those processes are still issuing I/Os within3011- * the mean seek distance. If not, it may be time to break the3012- * queues apart again.3013- */3014- if (cfq_cfqq_coop(cfqq)) {3015- if (CFQQ_SEEKY(cfqq) && !cfqq->seeky_start)3016- cfqq->seeky_start = jiffies;3017- else if (!CFQQ_SEEKY(cfqq))3018- cfqq->seeky_start = 0;3019- }3020}30213022/*···3444 return cic_to_cfqq(cic, 1);3445}34463447-static int should_split_cfqq(struct cfq_queue *cfqq)3448-{3449- if (cfqq->seeky_start &&3450- time_after(jiffies, cfqq->seeky_start + CFQQ_COOP_TOUT))3451- return 1;3452- return 0;3453-}3454-3455/*3456 * Returns NULL if a new cfqq should be allocated, or the old cfqq if this3457 * was the last process referring to said cfqq.···3452split_cfqq(struct cfq_io_context *cic, struct cfq_queue *cfqq)3453{3454 if (cfqq_process_refs(cfqq) == 1) {3455- cfqq->seeky_start = 0;3456 cfqq->pid = current->pid;3457 cfq_clear_cfqq_coop(cfqq);03458 return cfqq;3459 }3460···3493 /*3494 * If the queue was seeky for too long, break it apart.3495 */3496- if (cfq_cfqq_coop(cfqq) && should_split_cfqq(cfqq)) {3497 cfq_log_cfqq(cfqd, cfqq, "breaking apart cfqq");3498 cfqq = split_cfqq(cic, cfqq);3499 if (!cfqq)
···42 */43#define CFQ_MIN_TT (2)4400000045#define CFQ_SLICE_SCALE (5)46#define CFQ_HW_QUEUE_MIN (5)47#define CFQ_SERVICE_SHIFT 1248+49+#define CFQQ_SEEK_THR 8 * 102450+#define CFQQ_SEEKY(cfqq) ((cfqq)->seek_mean > CFQQ_SEEK_THR)5152#define RQ_CIC(rq) \53 ((struct cfq_io_context *) (rq)->elevator_private)···137 u64 seek_total;138 sector_t seek_mean;139 sector_t last_request_pos;0140141 pid_t pid;142···314 CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */315 CFQ_CFQQ_FLAG_sync, /* synchronous queue */316 CFQ_CFQQ_FLAG_coop, /* cfqq is shared */317+ CFQ_CFQQ_FLAG_split_coop, /* shared cfqq will be splitted */318 CFQ_CFQQ_FLAG_deep, /* sync cfqq experienced large depth */319 CFQ_CFQQ_FLAG_wait_busy, /* Waiting for next request */320};···342CFQ_CFQQ_FNS(slice_new);343CFQ_CFQQ_FNS(sync);344CFQ_CFQQ_FNS(coop);345+CFQ_CFQQ_FNS(split_coop);346CFQ_CFQQ_FNS(deep);347CFQ_CFQQ_FNS(wait_busy);348#undef CFQ_CFQQ_FNS···1566 cfq_clear_cfqq_wait_busy(cfqq);15671568 /*1569+ * If this cfqq is shared between multiple processes, check to1570+ * make sure that those processes are still issuing I/Os within1571+ * the mean seek distance. If not, it may be time to break the1572+ * queues apart again.1573+ */1574+ if (cfq_cfqq_coop(cfqq) && CFQQ_SEEKY(cfqq))1575+ cfq_mark_cfqq_split_coop(cfqq);1576+1577+ /*1578 * store what was left of this slice, if the queue idled/timed out1579 */1580 if (timed_out && !cfq_cfqq_slice_new(cfqq)) {···1662 else1663 return cfqd->last_position - blk_rq_pos(rq);1664}00016651666static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq,1667 struct request *rq, bool for_preempt)···3000 total = cfqq->seek_total + (cfqq->seek_samples/2);3001 do_div(total, cfqq->seek_samples);3002 cfqq->seek_mean = (sector_t)total;00000000000003003}30043005/*···3453 return cic_to_cfqq(cic, 1);3454}3455000000003456/*3457 * Returns NULL if a new cfqq should be allocated, or the old cfqq if this3458 * was the last process referring to said cfqq.···3469split_cfqq(struct cfq_io_context *cic, struct cfq_queue *cfqq)3470{3471 if (cfqq_process_refs(cfqq) == 1) {03472 cfqq->pid = current->pid;3473 cfq_clear_cfqq_coop(cfqq);3474+ cfq_clear_cfqq_split_coop(cfqq);3475 return cfqq;3476 }3477···3510 /*3511 * If the queue was seeky for too long, break it apart.3512 */3513+ if (cfq_cfqq_coop(cfqq) && cfq_cfqq_split_coop(cfqq)) {3514 cfq_log_cfqq(cfqd, cfqq, "breaking apart cfqq");3515 cfqq = split_cfqq(cic, cfqq);3516 if (!cfqq)
+3
drivers/block/cciss.c
···337 if (*pos > h->highest_lun)338 return 0;339000340 if (drv->heads == 0)341 return 0;342
···337 if (*pos > h->highest_lun)338 return 0;339340+ if (drv == NULL) /* it's possible for h->drv[] to have holes. */341+ return 0;342+343 if (drv->heads == 0)344 return 0;345