linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Mark Rustad <mrustad@mac.com>
Cc: linux-scsi@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: sg regression in 2.6.16-rc5
Date: Tue, 28 Feb 2006 14:53:14 -0500	[thread overview]
Message-ID: <4404AA2A.5010703@torque.net> (raw)
In-Reply-To: <E94491DE-8378-41DC-9C01-E8C1C91B6B4E@mac.com>

Mark Rustad wrote:
> We have encountered some kind of sg regression with kernel 2.6.16-rc5 
> relative to 2.6.15. We have a small program that demonstrates the 
> failure. On 2.6.15 it produces the output:
> 
> Alloced dataptr 0 -> 0xb7d07008
> IOS: 0
> ios 100
> 
> indicating that it did 100 operations successfully. On 2.6.16-rc5, it 
> produces the output:
> 
> Alloced dataptr 0 -> 0xa7d10008
> SG_IO ioctl error 12 Cannot allocate memory
> ios 0
> 
> indicating that it did 0 operations successfully. This program is 
> attempting to do 1MB reads on a SCSI device.

Mark,
You can stop right there with the 1 MB reads. Welcome
to the new, blander sg driver which now shares many
size shortcomings with the block subsystem.

In lk 2.6.15 the sg driver (and the st driver) did its
own scatter gather list allocations. The sg driver
used 32 KB segments (8 times the normal page size)
in each scatter gather element. The maximum number
of scatter gather elements depends on the LLD but
can be no more than 256. That meant the sg driver
allowed a maximum single IO size of 8 MB. There was
also a define in sg.h (SG_SCATTER_SZ and it is still
there) that allowed the 32KB per segment to be increased
allowing larger single command transfers (then 8 MB).

 We get the failure both  on
> an aic79xx parallel SCSI and on aic94xx SAS. With both types of 
> devices, it works fine on the 2.6.15 kernel. We have also seen this 
> problem on the 2.6.16-rc4 kernel. In all cases we were running on an 
> Intel Xeon-based system.

Well this is broken by design. If you and others
talk to the management it may be reversed or a
better solution may be found.

Here is an example of the sg driver in lk 2.6.15-rc5.
The number of bytes each SCSI READ command is trying
to fetch is 'bs * bpt'. Note that it works for 256 KB
per SCSI READ but fails for anything bigger:

# modprobe scsi_debug
# modprobe sg
# sg_dd if=/dev/sg0 of=. bs=512 bpt=512
16384+0 records in
16384+0 records out
# sg_dd if=/dev/sg0 of=. bs=512 bpt=513
sg_read failed, try reducing bpt, at or after lba=0 [0x0]
Some error occurred,  remaining block count=16384
0+0 records in
0+0 records out
# sg_dd if=/dev/sg0 of=. bs=512 bpt=1024
sg_read failed, try reducing bpt, at or after lba=0 [0x0]
Some error occurred,  remaining block count=16384
0+0 records in
0+0 records out


Doug Gilbert

  reply	other threads:[~2006-02-28 19:54 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-28 17:54 sg regression in 2.6.16-rc5 Mark Rustad
2006-02-28 19:53 ` Douglas Gilbert [this message]
2006-02-28 20:38   ` Kai Makisara
2006-03-01  2:04     ` Douglas Gilbert
2006-03-01  2:08     ` Mark Rustad
2006-03-01  8:38   ` Matthias Andree
2006-03-01 18:28     ` Linus Torvalds
2006-03-01 18:32       ` Mark Lord
2006-03-01 18:42         ` Linus Torvalds
2006-03-01 18:50           ` Matthew Wilcox
2006-03-03 18:27           ` Steve Byan
2006-03-03 18:55             ` Linus Torvalds
2006-03-03 19:13               ` Steve Byan
2006-03-03 19:42               ` Jeff Garzik
2006-03-03 20:09                 ` Linus Torvalds
2006-03-03 20:30                   ` Jeff Garzik
2006-03-01 19:33       ` Douglas Gilbert
2006-03-01 20:42         ` Mike Christie
2006-03-01 22:30           ` James Bottomley
2006-03-01 22:56             ` Mike Christie
2006-03-01 21:06         ` Kai Makisara
2006-03-02 19:50           ` Douglas Gilbert
2006-03-02 21:25             ` Linus Torvalds
2006-03-02 23:08               ` Matthias Andree
2006-03-02 23:20                 ` Linus Torvalds
2006-03-03  0:02                   ` Linus Torvalds
2006-03-03  0:12                     ` Linus Torvalds
2006-03-03 16:43                   ` Douglas Gilbert
2006-03-03 17:17                     ` Linus Torvalds
2006-03-02 23:06             ` Matthias Andree
  -- strict thread matches above, loose matches on Subject: below --
2006-03-02 23:04 Falkinder, David Malcolm
2006-03-03 20:24 Falkinder, David Malcolm
2006-03-03 21:54 ` Linus Torvalds

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=4404AA2A.5010703@torque.net \
    --to=dougg@torque.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mrustad@mac.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;
as well as URLs for NNTP newsgroup(s).