diff options
author | Vasily Tarasov <vtaras@openvz.org> | 2006-10-12 09:09:51 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2006-10-12 09:09:51 -0400 |
commit | d58cdfb89ce0c6bd5f81ae931a984ef298dbda20 (patch) | |
tree | f872c5b474411002f0905ebe702e752292f1cc21 | |
parent | cea2885a2e989d1dc19af1fc991717b33b7d1456 (diff) |
[PATCH] block layer: ioprio_best function fix
Currently ioprio_best function first checks wethere aioprio or bioprio equals
IOPRIO_CLASS_NONE (ioprio_valid() macros does that) and if it is so it returns
bioprio/aioprio appropriately. Thus the next four lines, that set aclass/bclass
to IOPRIO_CLASS_BE, if aclass/bclass == IOPRIO_CLASS_NONE, are never executed.
The second problem: if aioprio from class IOPRIO_CLASS_NONE and bioprio from
class IOPRIO_CLASS_IDLE are passed to ioprio_best function, it will return
IOPRIO_CLASS_IDLE. It means that during __make_request we can merge two
requests and set the priority of merged request to IDLE, while one of
the initial requests originates from a process with NONE (default) priority.
So we can get a situation when a process with default ioprio will experience
IO starvation, while there is no process from real-time class in the system.
Just removing ioprio_valid check should correct situation.
Signed-off-by: Vasily Tarasov <vtaras@openvz.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | fs/ioprio.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/ioprio.c b/fs/ioprio.c index 6dc6721d9e82..89e8da112a75 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c | |||
@@ -150,11 +150,6 @@ int ioprio_best(unsigned short aprio, unsigned short bprio) | |||
150 | unsigned short aclass = IOPRIO_PRIO_CLASS(aprio); | 150 | unsigned short aclass = IOPRIO_PRIO_CLASS(aprio); |
151 | unsigned short bclass = IOPRIO_PRIO_CLASS(bprio); | 151 | unsigned short bclass = IOPRIO_PRIO_CLASS(bprio); |
152 | 152 | ||
153 | if (!ioprio_valid(aprio)) | ||
154 | return bprio; | ||
155 | if (!ioprio_valid(bprio)) | ||
156 | return aprio; | ||
157 | |||
158 | if (aclass == IOPRIO_CLASS_NONE) | 153 | if (aclass == IOPRIO_CLASS_NONE) |
159 | aclass = IOPRIO_CLASS_BE; | 154 | aclass = IOPRIO_CLASS_BE; |
160 | if (bclass == IOPRIO_CLASS_NONE) | 155 | if (bclass == IOPRIO_CLASS_NONE) |