public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben@splentec.com>
To: Patrick Mansfield <patmans@us.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] 2.5.x use list_head to handle scsi starved request queues
Date: Mon, 24 Mar 2003 12:12:07 -0500	[thread overview]
Message-ID: <3E7F3C67.5010704@splentec.com> (raw)
In-Reply-To: 20030321165050.B9578@beaverton.ibm.com

Patrick Mansfield wrote:
> 
> The lock has to be held while checking shost->host_busy and then when
> removing the starved entry, we can have multiple cpu's in the function for
> the same adapter at the same time. Plus the lock has to be acquired prior
> to any __blk_run_queue call.

If scsi_queue_next_request(q, cmd) is running on more than one CPU
and q != q1 then you have a problem with the starved devices list.

I.e. the lock for an object should NOT depend on the circumstances --
an object (or set of objects) should _always_ use the same lock, if
any.

For this reason, when you obtain the q->queue_lock, just use it
around your critical section and __blk_run_queue(), in a minimalistic
approach, then release it.

Then have a starved_list_lock, or use the host->lock (extreme and I do NOT
recommend it) to lock your starved_list.

So, obtain the starved_list_lock, go over the devices, get their request
queues's lock and call __blk_run_queue(sdev->request_queue), then release
the sdev->request_queue->queue_lock and loop over again if needed,
when done, release the starved_list_lock.

Remember that, someone else might want to *rearrange* the order of
devices in the starved list for, say, _prioritization_, at some other
time when there is no queue in context! (thus a starved_list_lock would
make most sense)

> I am still working patches for the lock split up in this area.

Good!

-- 
Luben



  reply	other threads:[~2003-03-24 17:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-20  2:27 [PATCH] 2.5.x use list_head to handle scsi starved request queues Patrick Mansfield
2003-03-20 20:05 ` Luben Tuikov
2003-03-21  4:39   ` Patrick Mansfield
2003-03-21 20:48     ` Luben Tuikov
2003-03-22  0:50       ` Patrick Mansfield
2003-03-24 17:12         ` Luben Tuikov [this message]
2003-03-24 19:29           ` Patrick Mansfield
2003-03-24 20:20             ` Luben Tuikov
2003-03-24 20:25               ` Jens Axboe
2003-03-24 20:38                 ` Patrick Mansfield
2003-03-24 21:25                   ` Luben Tuikov
2003-03-24 21:56                     ` Patrick Mansfield
2003-03-24 22:15                       ` Luben Tuikov
2003-03-24 21:30                 ` Luben Tuikov

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=3E7F3C67.5010704@splentec.com \
    --to=luben@splentec.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=patmans@us.ibm.com \
    /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