Skip to contentSkip to conversation

noop-iosched: do not attempt to sort requests

PATCH In review Tahsin Erdogan 1 participant 2 messages Jul 23, 2015 – Jul 30, 2015 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 noop-iosched: do not attempt to sort requests

Noop scheduler currently dispatches a request by calling elv_dispatch_sort(). In practice, sorting does not occur because __elv_next_request() asks the io scheduler to dispatch a request only when elevator queue is empty.

Also, not reordering requests seems more appropriate for noop. This change makes the behavior more explicit.

---
 block/Kconfig.iosched | 8 ++++----
 block/noop-iosched.c  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
block/Kconfig.iosched +4 -4
index 421bef9..b9e42f8 100644
@@ -7,10 +7,10 @@ config IOSCHED_NOOP
 	default y
 	---help---
 	  The no-op I/O scheduler is a minimal scheduler that does basic merging
-	  and sorting. Its main uses include non-disk based block devices like
-	  memory devices, and specialised software or hardware environments
-	  that do their own scheduling and require only minimal assistance from
-	  the kernel.
+	  only. Its main uses include non-disk based block devices like memory
+	  devices, and specialised software or hardware environments that do
+	  their own scheduling and require only minimal assistance from the
+	  kernel.
 
 config IOSCHED_DEADLINE
 	tristate "Deadline I/O scheduler"
block/noop-iosched.c +1 -1
index 3de89d4..f0fec14 100644
@@ -26,7 +26,7 @@ static int noop_dispatch(struct request_queue *q, int force)
 		struct request *rq;
 		rq = list_entry(nd->queue.next, struct request, queuelist);
 		list_del_init(&rq->queuelist);
-		elv_dispatch_sort(q, rq);
+		elv_dispatch_add_tail(q, rq);
 		return 1;
 	}
 	return 0;
Signature · 1 line
2.4.3.573.g4eafbef
#1 lore raw

Hi Jens, did you get a chance to take a look at this patch?

Quoted 50 lines · Tahsin Erdogan

Noop scheduler currently dispatches a request by calling elv_dispatch_sort(). In practice, sorting does not occur because __elv_next_request() asks the io scheduler to dispatch a request only when elevator queue is empty.

Also, not reordering requests seems more appropriate for noop. This change makes the behavior more explicit.

---
 block/Kconfig.iosched | 8 ++++----
 block/noop-iosched.c  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
block/Kconfig.iosched +4 -4
index 421bef9..b9e42f8 100644
@@ -7,10 +7,10 @@ config IOSCHED_NOOP
        default y
        ---help---
          The no-op I/O scheduler is a minimal scheduler that does basic merging
-         and sorting. Its main uses include non-disk based block devices like
-         memory devices, and specialised software or hardware environments
-         that do their own scheduling and require only minimal assistance from
-         the kernel.
+         only. Its main uses include non-disk based block devices like memory
+         devices, and specialised software or hardware environments that do
+         their own scheduling and require only minimal assistance from the
+         kernel.
 
 config IOSCHED_DEADLINE
        tristate "Deadline I/O scheduler"
block/noop-iosched.c +1 -2
index 3de89d4..f0fec14 100644
@@ -26,7 +26,7 @@ static int noop_dispatch(struct request_queue *q, int force)
                struct request *rq;
                rq = list_entry(nd->queue.next, struct request, queuelist);
                list_del_init(&rq->queuelist);
-               elv_dispatch_sort(q, rq);
+               elv_dispatch_add_tail(q, rq);
                return 1;
        }
        return 0;
--

2.4.3.573.g4eafbef