diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2009-07-09 16:13:16 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.(none)> | 2009-07-10 14:31:54 -0400 |
commit | 32f2e807a3938b24d0831211e6094f9e44b2fc83 (patch) | |
tree | 80baac86022bc36bc07a787008642149fa205642 | |
parent | ecb554a846f8e9d2a58f6d6c118168a63ac065aa (diff) |
cfq-iosched: reset oom_cfqq in cfq_set_request()
In case memory is scarce, we now default to oom_cfqq. Once memory is
available again, we should allocate a new cfqq and stop using oom_cfqq for
a particular io context.
Once a new request comes in, check if we are using oom_cfqq, and if yes,
try to allocate a new cfqq.
Tested the patch by forcing the use of oom_cfqq and upon next request thread
realized that it was using oom_cfqq and it allocated a new cfqq.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/cfq-iosched.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 87276eb83f7f..fd7080ed7935 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -2311,7 +2311,7 @@ cfq_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask) | |||
2311 | goto queue_fail; | 2311 | goto queue_fail; |
2312 | 2312 | ||
2313 | cfqq = cic_to_cfqq(cic, is_sync); | 2313 | cfqq = cic_to_cfqq(cic, is_sync); |
2314 | if (!cfqq) { | 2314 | if (!cfqq || cfqq == &cfqd->oom_cfqq) { |
2315 | cfqq = cfq_get_queue(cfqd, is_sync, cic->ioc, gfp_mask); | 2315 | cfqq = cfq_get_queue(cfqd, is_sync, cic->ioc, gfp_mask); |
2316 | cic_set_cfqq(cic, cfqq, is_sync); | 2316 | cic_set_cfqq(cic, cfqq, is_sync); |
2317 | } | 2317 | } |