mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jeff V. Merkey" <jmerkey@vger.timpanogas.org>
To: Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: queue_nr_requests needs to be selective
Date: Fri, 1 Mar 2002 17:27:01 -0700	[thread overview]
Message-ID: <20020301172701.A12718@vger.timpanogas.org> (raw)
In-Reply-To: <20020301132254.A11528@vger.timpanogas.org> <3C7FE7DD.98121E87@zip.com.au>, <3C7FE7DD.98121E87@zip.com.au>; <20020301162016.A12413@vger.timpanogas.org> <3C800D66.F613BBAA@zip.com.au>
In-Reply-To: <3C800D66.F613BBAA@zip.com.au>; from akpm@zip.com.au on Fri, Mar 01, 2002 at 03:23:18PM -0800

On Fri, Mar 01, 2002 at 03:23:18PM -0800, Andrew Morton wrote:
> "Jeff V. Merkey" wrote:
> > 
> > The issue here is that it sleeps too much
> > and what's really happening and that we are forcing 8 disk drives
> > toshare 64/128 request buffers rather than provide each physical disk
> > with what it really needs.
> 
> OK.  So would it suffice to make queue_nr_requests an argument to
> a new blk_init_queue()?
> 
> -	blk_init_queue(q, sci_request);
> +	blk_init_queue_ng(q, sci_request, 1024);
> 

Andrew,

Yep.  This will do it.  3Ware (Adam) and the other RAID card folks 
would need to call and setup their queues based on how many disks 
are actually attached to the controller (which they know based on
their local state).  It would be great if this value were maintained as
adapter specific, i.e.

id blk_init_queue(request_queue_t * q, request_fn_proc * rfn, int depth)
{
        INIT_LIST_HEAD(&q->queue_head);
        elevator_init(&q->elevator, ELEVATOR_LINUS);
        blk_init_free_list(q);
        q->request_fn           = rfn;
        q->back_merge_fn        = ll_back_merge_fn;
        q->front_merge_fn       = ll_front_merge_fn;
        q->merge_requests_fn    = ll_merge_requests_fn;
        q->make_request_fn      = __make_request;
        q->plug_tq.sync         = 0;
        q->plug_tq.routine      = &generic_unplug_device;
        q->plug_tq.data         = q;
        q->plugged              = 0;

        // NEW CODE

        if (depth > 1024)
           depth = 1024;
        q->queue_nr_requests_local = (depth ? depth : -1);

        //  

        /*
         * These booleans describe the queue properties.  We set the
         * default (and most common) values here.  Other drivers can
         * use the appropriate functions to alter the queue properties.
         * as appropriate.
         */
        q->plug_device_fn       = generic_plug_device;
        q->head_active          = 1;
}

and the modify this function something like this:

static void blk_init_free_list(request_queue_t *q)
{
        struct request *rq;
        int i;

        // NEW CODE
        //
        int queue_depth;

        queue_depth = ((q->queue_nr_requests_local != -1)
                      ? q->queue_nr_requests_local
                      : queue_nr_requests);
        //
        //

        INIT_LIST_HEAD(&q->rq[READ].free);
        INIT_LIST_HEAD(&q->rq[WRITE].free);
        q->rq[READ].count = 0;
        q->rq[WRITE].count = 0;

        /*
         * Divide requests in half between read and write
         */

//        for (i = 0; i < queue_nr_requests; i++) {
        for (i = 0; i < queue_depth; i++) {

                rq = kmem_cache_alloc(request_cachep, SLAB_KERNEL);
                if (rq == NULL) {
                        /* We'll get a `leaked requests' message from blk_cleanup_queue */
                        printk(KERN_EMERG "blk_init_free_list: error allocating
requests\n");
                        break;
                }
                memset(rq, 0, sizeof(struct request));
                rq->rq_status = RQ_INACTIVE;
                list_add(&rq->queue, &q->rq[i&1].free);
                q->rq[i&1].count++;
        }

        init_waitqueue_head(&q->wait_for_request);
        spin_lock_init(&q->queue_lock);
}

and we're there.

:-)

Jeff

> 
> 
> -
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2002-03-02  0:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-01 20:22 Jeff V. Merkey
2002-03-01 20:43 ` Andrew Morton
2002-03-01 21:03   ` Alan Cox
2002-03-01 23:22     ` Jeff V. Merkey
2002-03-01 23:20   ` Jeff V. Merkey
2002-03-01 23:23     ` Andrew Morton
2002-03-02  0:27       ` Jeff V. Merkey [this message]
2002-03-02  0:49         ` Andrew Morton
2002-03-02  2:16           ` Jeff V. Merkey
2002-03-02  3:50             ` Andrew Morton
2002-03-02  4:34               ` Jeff V. Merkey
2002-03-02  7:33               ` Jeff V. Merkey
2002-03-02  9:10               ` Jens Axboe
2002-03-02  9:22                 ` Andrew Morton
2002-03-04  9:09                   ` Jens Axboe
2002-03-02  0:51 ` Mike Anderson
2002-03-02  4:39   ` Jeff V. Merkey
2002-03-02  5:59     ` Jeff V. Merkey
2002-03-02  6:01       ` Jeff V. Merkey
2002-03-02  6:16         ` Jeff V. Merkey
2002-03-04  7:16       ` Mike Anderson
2002-03-04 17:39         ` Jeff V. Merkey

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=20020301172701.A12718@vger.timpanogas.org \
    --to=jmerkey@vger.timpanogas.org \
    --cc=akpm@zip.com.au \
    --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®