From: Corrado Zoccolo <czoccolo@gmail.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: "Linux-Kernel" <linux-kernel@vger.kernel.org>,
Jeff Moyer <jmoyer@redhat.com>
Subject: [PATCH v2] cfq-iosched: avoid probable slice overrun when idling
Date: Wed, 7 Oct 2009 23:15:41 +0200 [thread overview]
Message-ID: <200910072315.42047.czoccolo@gmail.com> (raw)
In-Reply-To: <4e5e476b0910071230x4adf48eava152bebb149d53e4@mail.gmail.com>
Idle timer is not armed if remaining slice is less than average think
time.
Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
---
block/cfq-iosched.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index b35cc56..af1d621 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1099,6 +1099,14 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
if (!cic || !atomic_read(&cic->ioc->nr_tasks))
return;
+ /*
+ * think time is greater than remaining time slice
+ * don't idle, to avoid overrunnig the time slice
+ */
+ if (sample_valid(cic->ttime_samples) &&
+ (cfqq->slice_end - jiffies < cic->ttime_mean))
+ return;
+
cfq_mark_cfqq_wait_request(cfqq);
/*
--
1.6.2.5
next prev parent reply other threads:[~2009-10-07 21:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-07 8:59 [PATCH] cfq-iosched: avoid " Corrado Zoccolo
2009-10-07 17:51 ` Jens Axboe
2009-10-07 19:30 ` Corrado Zoccolo
2009-10-07 21:15 ` Corrado Zoccolo [this message]
2009-10-08 6:41 ` [PATCH v2] cfq-iosched: avoid probable " Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200910072315.42047.czoccolo@gmail.com \
--to=czoccolo@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=jmoyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome