All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Willem Riede <wrlk@riede.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: Badness in scsi_single_lun_run at /root/scsi/scsi_lib.c:344
Date: Wed, 28 Jan 2004 08:41:43 -0800	[thread overview]
Message-ID: <20040128084142.A4835@beaverton.ibm.com> (raw)
In-Reply-To: <20040128033041.GY23308@serve.riede.org>; from wrlk@riede.org on Tue, Jan 27, 2004 at 10:30:41PM -0500

On Tue, Jan 27, 2004 at 10:30:41PM -0500, Willem Riede wrote:
> On 2004.01.26 19:32, Willem Riede wrote:
> > Jan 26 17:13:23 fallguy kernel: Badness in scsi_single_lun_run at /root/scsi/scsi_lib.c:344

I was trying to figure out what happened, apparently I missed a check when
splitting the locks up and removing a lock hiearchy.

Per changeset 1.75.1.8, at this link:

http://linux.bkbits.net:8080/linux-2.5/diffs/drivers/scsi/scsi_lib.c@1.75.1.8?nav=index.html|src/|src/drivers|src/drivers/scsi|hist/drivers/scsi/scsi_lib.c

We should only clear starget_sdev_user when the sdev has no more IO. We
want to run (a bunch of) IO for a given starget_sdev_user, and when there is
no more IO, clear starget_sdev_user so someone else has a chance to run.

I'm trying to figure out a fix without adding any lock hiearchy. queue_lock
protects device_busy, but host_lock protects starget_sdev_user.

The single lun devices and code are annoying :-(

Do you know if the single lun code is for performance, or because of
hardware limitations - that is we don't want a disc change between IO, or
does the device just fail?

> scsi_lib.c contains the following code:
> 
>                 spin_lock(shost->host_lock);
>                                                                                                                         
>                 spin_unlock_irq(shost->host_lock);
> 
> 
> Is it a problem that the lock is taken by means of spin_lock() and then
> released with spin_unlock_irq() ? We do need to lock against scsi_softirq
> as in the backtrace above...

No, the previous unlock kept interrupts disabled, the code path looks like:

	spin_lock_irq(q->queue_lock);
	...
	spin_unlock(q->queue_lock);
	spin_lock(shost->host_lock);
	...
	spin_unlock_irq(shost->host_lock);

-- Patrick Mansfield

  reply	other threads:[~2004-01-28 16:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-27  0:32 Badness in scsi_single_lun_run at /root/scsi/scsi_lib.c:344 Willem Riede
2004-01-28  3:30 ` Willem Riede
2004-01-28 16:41   ` Patrick Mansfield [this message]
2004-01-28 17:36     ` Willem Riede
2004-01-28 17:53       ` Patrick Mansfield
2004-01-28 18:33         ` Willem Riede
2004-01-28 18:37         ` Matthew Wilcox
2004-01-30 20:14   ` [PATCH] fix badness in scsi_single_lun_run Patrick Mansfield

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=20040128084142.A4835@beaverton.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=wrlk@riede.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.