mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
[PATCH] noop-iosched: kill O(N) merge scan
Profiling hit rates on merging shows that the last merge hint works extremely well for most work loads. So lets kill the linear merge scan in noop-iosched, so it provides O(1) run time for any operation. Testing credits go to Ken Chen from Intel. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
41f11a4fa3
commit
1181c1f923
1 changed files with 3 additions and 24 deletions
|
@ -13,36 +13,15 @@
|
||||||
static int elevator_noop_merge(request_queue_t *q, struct request **req,
|
static int elevator_noop_merge(request_queue_t *q, struct request **req,
|
||||||
struct bio *bio)
|
struct bio *bio)
|
||||||
{
|
{
|
||||||
struct list_head *entry = &q->queue_head;
|
|
||||||
struct request *__rq;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = elv_try_last_merge(q, bio))) {
|
ret = elv_try_last_merge(q, bio);
|
||||||
|
if (ret != ELEVATOR_NO_MERGE)
|
||||||
*req = q->last_merge;
|
*req = q->last_merge;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((entry = entry->prev) != &q->queue_head) {
|
|
||||||
__rq = list_entry_rq(entry);
|
|
||||||
|
|
||||||
if (__rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER))
|
|
||||||
break;
|
|
||||||
else if (__rq->flags & REQ_STARTED)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!blk_fs_request(__rq))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ((ret = elv_try_merge(__rq, bio))) {
|
|
||||||
*req = __rq;
|
|
||||||
q->last_merge = __rq;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ELEVATOR_NO_MERGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void elevator_noop_merge_requests(request_queue_t *q, struct request *req,
|
static void elevator_noop_merge_requests(request_queue_t *q, struct request *req,
|
||||||
struct request *next)
|
struct request *next)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue