mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: Jens Axboe <axboe@suse.de>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: blk_queue_congestion_threshold()
Date: Wed, 3 Nov 2004 19:10:50 -0500	[thread overview]
Message-ID: <200411031913_MC3-1-8DE3-3DC@compuserve.com> (raw)

  Looking at this function in ll_rw_blk.c:


static void blk_queue_congestion_threshold(struct request_queue *q)
{
        int nr;

        nr = q->nr_requests - (q->nr_requests / 8) + 1;
        if (nr > q->nr_requests)
                nr = q->nr_requests;
        q->nr_congestion_on = nr;

        nr = q->nr_requests - (q->nr_requests / 8) - 1;
        if (nr < 1)
                nr = 1;
        q->nr_congestion_off = nr;
}


  Why are the "on" and "off" thresholds the same, i.e. shouldn't there be some
hysteresis?  Con Kolivas posted a patch that changed the "off" threshold to
"nr_requests - nr_requests/8 - nr_requests/16" and it was said to be better,
but it never made it into mainline (it also changed get_request_wait() and that
was never merged either):


--- patches/linux-2.6.9-rc4-ck1/drivers/block/ll_rw_blk.c       2004-10-12 12:25:09.798003278 +0200
+++ linux-2.6.9-rc4-ck1/drivers/block/ll_rw_blk.c       2004-10-12 12:25:42.959479479 +0200
@@ -100,7 +100,7 @@
                nr = q->nr_requests;
        q->nr_congestion_on = nr;
 
-       nr = q->nr_requests - (q->nr_requests / 8) - 1;
+       nr = q->nr_requests - (q->nr_requests / 8) - (q->nr_requests/16)- 1;
        if (nr < 1)
                nr = 1;
        q->nr_congestion_off = nr;
@@ -1758,8 +1758,10 @@
 {
        DEFINE_WAIT(wait);
        struct request *rq;
+       struct io_context *ioc;
 
        generic_unplug_device(q);
+       ioc = get_io_context(GFP_NOIO);
        do {
                struct request_list *rl = &q->rq;
 
@@ -1769,7 +1771,6 @@
                rq = get_request(q, rw, GFP_NOIO);
 
                if (!rq) {
-                       struct io_context *ioc;
 
                        io_schedule();
 
@@ -1779,12 +1780,11 @@
                         * up to a big batch of them for a small period time.
                         * See ioc_batching, ioc_set_batching
                         */
-                       ioc = get_io_context(GFP_NOIO);
                        ioc_set_batching(q, ioc);
-                       put_io_context(ioc);
                }
                finish_wait(&rl->wait[rw], &wait);
        } while (!rq);
+       put_io_context(ioc);
 
        return rq;
 }



--Chuck Ebbert  03-Nov-04  19:58:53

             reply	other threads:[~2004-11-04  0:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-04  0:10 Chuck Ebbert [this message]
2004-11-04  0:47 ` blk_queue_congestion_threshold() Nick Piggin
2004-11-04  9:16   ` blk_queue_congestion_threshold() 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=200411031913_MC3-1-8DE3-3DC@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=axboe@suse.de \
    --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

all inboxes | Powered by JetHome®