mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Bottomley <jbottomley@parallels.com>
To: "Elliott@hp.com" <Elliott@hp.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hch@infradead.org" <hch@infradead.org>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"michaelc@cs.wisc.edu" <michaelc@cs.wisc.edu>,
	"kys@microsoft.com" <kys@microsoft.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"ohering@suse.com" <ohering@suse.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>
Subject: Re: [PATCH 1/1] [SCSI] Fix a bug in deriving the FLUSH_TIMEOUT from the basic I/O timeout
Date: Fri, 18 Jul 2014 17:41:05 +0000	[thread overview]
Message-ID: <1405705265.30262.6.camel@dabdike.int.hansenpartnership.com> (raw)
In-Reply-To: <94D0CD8314A33A4D9D801C0FE68B402958BB2E3D@G9W0745.americas.hpqcorp.net>

On Fri, 2014-07-18 at 17:17 +0000, Elliott, Robert (Server Storage)
wrote:
> 
> 
> > From: James Bottomley [mailto:jbottomley@parallels.com]
> > 
> > On Fri, 2014-07-18 at 00:51 +0000, Elliott, Robert (Server Storage)
> > wrote:
> ...
> > >
> > > Also, in both sd_setup_flush_cmnd and sd_sync_cache:
> > >       cmd->cmnd[0] = SYNCHRONIZE_CACHE;
> > >       cmd->cmd_len = 10;
> > >
> > > SYNCHRONIZE CACHE (16) should be favored over SYNCHRONIZE
> > > CACHE (10) unless SYNCHRONIZE CACHE (10) is not supported.
> 
> (sorry - meant "unless ... 16 is not supported")

Yes, I guessed that?

> > For what reason.  We usually go for the safe alternatives, which is 10
> > byte commands because they have the widest testing and greatest level of
> > support.  We don't do range flushes currently, so there doesn't seem to
> > be a practical different.  If we did support range flushes, we'd likely
> > only use SC(16) on >2TB devices.
> > 
> > James
> 
> A goal of the simplified SCSI feature set idea is to drop all the
> short CDBs that have larger, more capable equivalents - don't carry
> READ 6/10/12/16 and SYNCHRONIZE CACHE 10/16, just keep the 16-byte 
> versions.  With modern serial IU-based protocols, short CDBs don't 
> save any transfer time.  This will simplify design and testing on
> both initiator and target sides. Competing command sets like NVMe 
> rightly point out that SCSI has too much legacy baggage - all you 
> need for IO is one READ, one WRITE, and one FLUSH command.

But that's not relevant to us.  This is the problem of practical vs
standards approaches.  We have to support older and buggy devices.  Most
small USB storage sticks die if they see 16 byte CDB commands because
their interpreters.  The more "legacy baggage" the standards committee
dumps, the greater the number of heuristics OSs have to have to cope
with the plethora of odd devices.

> That's why SBC-3 ended up with these warning notes for all the
> non-16 byte CDBs:
> 
> 	NOTE 15 - Migration from the SYNCHRONIZE CACHE (10) command to
> 	the SYNCHRONIZE CACHE (16) command is recommended for all
> 	implementations.
> 
> If the LBA field in SYNCHRONIZE CACHE went obsolete, then maybe
> SYNCHRONIZE CACHE (10) would be kept instead of (16), but that
> field is still present.  So, (16) is the likely survivor.

OK, but look at it from our point of view:  The reply above justifies
why we prefer 10 byte CDBs over 16.  If the standards body ever did
remove SC(10) completely, then we'd have to have yet another heuristic
to recognise devices that don't support SC(10), but until that day,
using SC(10) alone works in all cases, so is the better path for the OS.

If you could, please get the standards body to recognise that the more
command churn they introduce (in the name of rationalisation or
whatever), the more problems they introduce for Operating Systems and
the more likelihood (because of different people reading different
revisions of standards) that we end up with compliance bugs in devices.

James


  reply	other threads:[~2014-07-18 17:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 16:33 K. Y. Srinivasan
2014-06-04 17:02 ` James Bottomley
2014-06-04 17:15   ` KY Srinivasan
2014-06-06  1:32     ` Mike Christie
2014-06-06  2:53       ` KY Srinivasan
2014-06-06 17:18         ` Mike Christie
2014-06-06 17:52           ` James Bottomley
2014-06-06 18:22             ` Jens Axboe
2014-06-20 21:36               ` KY Srinivasan
2014-07-17 23:53                 ` KY Srinivasan
2014-07-18  0:51                   ` Elliott, Robert (Server Storage)
2014-07-18 15:11                     ` Christoph Hellwig (hch@infradead.org)
2014-07-18 15:39                     ` James Bottomley
2014-07-18 17:17                       ` Elliott, Robert (Server Storage)
2014-07-18 17:41                         ` James Bottomley [this message]
2014-07-18 18:16                           ` Douglas Gilbert
2014-07-18 15:10                   ` Christoph Hellwig (hch@infradead.org)
2014-07-18 16:44                     ` KY Srinivasan
2014-07-18 16:57                       ` James Bottomley
2014-07-18 17:01                         ` hch
2014-07-18 17:05                         ` KY Srinivasan
2014-07-18 17:12                           ` hch
2014-07-18 17:15                             ` hch
2014-07-18 17:00 ` Christoph Hellwig
2014-07-18 17:03   ` James Bottomley

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=1405705265.30262.6.camel@dabdike.int.hansenpartnership.com \
    --to=jbottomley@parallels.com \
    --cc=Elliott@hp.com \
    --cc=apw@canonical.com \
    --cc=axboe@kernel.dk \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=ohering@suse.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

all inboxes | Powered by JetHome®