sector_t last_sector[2]; /* last REQ_SYNC & REQ_ASYNC sectors */
struct list_head *dispatch; /* driver dispatch queue */
struct list_head *hash; /* request hash */
+ unsigned long new_success; /* anticipation success on new proc */
unsigned long current_batch_expires;
unsigned long last_check_fifo[2];
int changed_batch; /* 1: waiting for old batch to end */
int status = ad->antic_status;
if (status == ANTIC_WAIT_REQ || status == ANTIC_WAIT_NEXT) {
+ struct as_io_context *aic;
+
if (status == ANTIC_WAIT_NEXT)
del_timer(&ad->antic_timer);
ad->antic_status = ANTIC_FINISHED;
/* see as_work_handler */
kblockd_schedule_work(&ad->antic_work);
+
+ aic = ad->io_context->aic;
+ if (aic->seek_samples == 0)
+ /* new process */
+ ad->new_success = (ad->new_success * 3) / 4 + 256;
}
}
spin_lock_irqsave(q->queue_lock, flags);
if (ad->antic_status == ANTIC_WAIT_REQ
|| ad->antic_status == ANTIC_WAIT_NEXT) {
+ struct as_io_context *aic;
ad->antic_status = ANTIC_FINISHED;
kblockd_schedule_work(&ad->antic_work);
+
+ aic = ad->io_context->aic;
+ if (aic->seek_samples == 0)
+ /* new process */
+ ad->new_success = (ad->new_success * 3) / 4;
}
spin_unlock_irqrestore(q->queue_lock, flags);
}
return 1;
}
- if (aic->seek_samples == 0 || aic->ttime_samples == 0) {
+ if (ad->new_success < 256 &&
+ (aic->seek_samples == 0 || aic->ttime_samples == 0)) {
/*
- * Process has just started IO so default to not anticipate.
- * Maybe should be smarter.
+ * Process has just started IO and we have a bad history of
+ * success anticipating on new processes!
*/
return 1;
}
ad->write_batch_count = ad->batch_expire[REQ_ASYNC] / 10;
if (ad->write_batch_count < 2)
ad->write_batch_count = 2;
+
+ ad->new_success = 512;
+
return 0;
}