public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
To: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
Cc: Alan Stern
	<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
	Matthew Dharm
	<mdharm-scsi-JGfshJpz5UybPZpvUQj5UqxOck334EZe@public.gmane.org>,
	linux-scsi <linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	USB list <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: Re: [PATCH] isd200: Use scsi_get_cmnd for the extra translation command
Date: Thu, 13 Mar 2008 11:47:57 -0500	[thread overview]
Message-ID: <1205426877.2893.14.camel@localhost.localdomain> (raw)
In-Reply-To: <47D8128D.3050405-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>

On Wed, 2008-03-12 at 19:27 +0200, Boaz Harrosh wrote:
> On Wed, Mar 12 2008 at 19:00 +0200, James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org> wrote:
> > On Wed, 2008-03-12 at 17:15 +0200, Boaz Harrosh wrote:
> >> James
> >> please comment on the use of DID_REQUEUE as return status for 
> >> the command in case of failure to allocate the extra command the first
> >> time.
> > 
> > I'm afraid it won't work.  If you get a NULL return from
> > scsi_get_command, it means that the command you already have was likely
> > taken from the host free_list.  If that command is in the memory
> > clearing writeout path and we don't have any returning commands to
> > replace the free_list, the system is now deadlocked.
> > 
> > James
> > 
> 
> I'm not sure you are right. Please bear in mind that for isd200 an host
> has exactly one device. Now this *very first command* is some kind of
> INQUIRY in the discovery process, so it cannot be mounted for SWAP as yet.
> so it cannot be in the "clearing writeout path". Any kind of error on this
> first command will just result in an "empty" device, No? 

Not with DID_REQUEUE, it won't: it will go round until the command times
out, which is not too long, but unnecessary.

> I guess a newly mounted device on a memory starved system has lots of places 
> to fail before and after this point in time.

The basic problem, I suppose is that the whole structure is wrong.  The
only reason you try this strange method of allocation is because there's
no way to pull a command off the relevant pool without setting up the
host.  Export such a method and we can do the allocation at start of day
where it should be done.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2008-03-13 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-12 15:15 [PATCH] isd200: Use scsi_get_cmnd for the extra translation command Boaz Harrosh
     [not found] ` <47D7F397.4070903-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2008-03-12 16:00   ` Boaz Harrosh
2008-03-12 17:00   ` James Bottomley
2008-03-12 17:27     ` Boaz Harrosh
     [not found]       ` <47D8128D.3050405-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2008-03-13 16:47         ` James Bottomley [this message]

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=1205426877.2893.14.camel@localhost.localdomain \
    --to=james.bottomley-d9phhud1jfjcxq6kfmz53/egyhegw8jk@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mdharm-scsi-JGfshJpz5UybPZpvUQj5UqxOck334EZe@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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