public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <mikenc@us.ibm.com>
To: Jens Axboe <axboe@suse.de>
Cc: linux-kernel@vger.kernel.org, wa@almesberger.net
Subject: Re: [PATCH] modular io schedulers with online switching, #2
Date: Fri, 17 Sep 2004 03:13:38 -0700	[thread overview]
Message-ID: <414AB8D2.2080905@us.ibm.com> (raw)
In-Reply-To: <20040917094436.GB2911@suse.de>

Jens Axboe wrote
> +void blk_wait_queue_drained(request_queue_t *q)
> +{
> +	struct request_list *rl = &q->rq;
> +	DEFINE_WAIT(wait);
> +
> +	set_bit(QUEUE_FLAG_DRAIN, &q->queue_flags);
> +
> +	prepare_to_wait(&rl->drain, &wait, TASK_UNINTERRUPTIBLE);
> +	do {
> +		spin_lock_irq(q->queue_lock);
> +		if (!rl->count[READ] && !rl->count[WRITE]) {
> +			spin_unlock_irq(q->queue_lock);
> +			break;
> +		}
> +
> +		__generic_unplug_device(q);
> +		spin_unlock_irq(q->queue_lock);
> +		io_schedule();
> +	} while (1);
> +	finish_wait(&rl->drain, &wait);
> +}
> +

Jens,

If a driver does not allocate requests through blk_get_request, will the 
rl->count[] tests need to be changed or do those drivers need to be 
changed? For example, if SCSI insterts a special request into the queue, 
then someone swaps the io scheduler with no outstanding normal requests 
(so the rl->counts will be zero), could the special request still be in 
the queue since it allocated its request using kmalloc (the request is 
allocated as part of the scsi command).

Mike

  reply	other threads:[~2004-09-17 22:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-17  9:44 [PATCH] modular io schedulers with online switching, #2 Jens Axboe
2004-09-17 10:13 ` Mike Christie [this message]
2004-09-18  8:29   ` Jens Axboe
2004-09-18  8:51     ` 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=414AB8D2.2080905@us.ibm.com \
    --to=mikenc@us.ibm.com \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wa@almesberger.net \
    /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