From: Douglas Gilbert <dougg@torque.net>
To: Mike Anderson <andmike@us.ibm.com>
Cc: Haofeng Kou <haofengk@ptu.promise.com>, linux-scsi@vger.kernel.org
Subject: Re: SCSI Command scatter-gather number
Date: Tue, 30 Jul 2002 23:22:39 -0400 [thread overview]
Message-ID: <3D4757FF.9F91971F@torque.net> (raw)
In-Reply-To: 20020730144326.A26330@beaverton.ibm.com
Mike Anderson wrote:
>
> On 2.4 the use_sg value should be limited to the smaller of MAX_SEGMENTS
> or the scsi host sg_tablesize.
>
> This is checked in the block interface during __make_request. I believe if
> you got through the sg interface the limiting value is only sg_tablesize,
> but Doug is the best one to answer that.
Mike,
Yes, the sg driver limits the number of elements in a scatter
gather list to Scsi_Host::sg_tablesize . I haven't seen these
values over 256 but I can't see anything enforcing that (and
the type of sg_tablesize is unsigned short). [Perhaps
Scsi_Cmnd::use_sg was a unsigned char at some time in the
past.]
The 2 LLDD I use the most are advansys and sym53c8xx and
they have fixed values of 255 and 96 respectively. Small
numbers only seem to be a problem with direct IO when large
transfers (with a single command) are attempted. Since
direct IO remaps a large data block from the user space
allocated by malloc() to a scatter gather list, it must
cope with the typical case in which every page is
discontinuous. So in the case of the sym53c8xx on i386
the biggest direct IO transfer that can be done is
96 * 4KB == 384KB .
Doug Gilbert
> -Mike
>
> Haofeng Kou [haofengk@ptu.promise.com] wrote:
> > For the "struct scsi_cmnd", there is a member :
> > unsigned short use_sg;
> > Which gives the Number of pieces of the scatter-gather.
> >
> > How to limit its value, how to set the max value for the "use_sg"?
> >
> >
> > Thanks,
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> --
> Michael Anderson
> andmike@us.ibm.com
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2002-07-31 3:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-30 21:07 SCSI Command scatter-gather number Haofeng Kou
2002-07-30 21:33 ` Kurt Garloff
2002-07-30 21:43 ` Mike Anderson
2002-07-31 3:22 ` Douglas Gilbert [this message]
2002-07-31 5:11 ` Doug Ledford
2002-07-31 5:26 ` Matthew Jacob
2002-07-31 7:44 ` Jeremy Higdon
2002-07-31 13:36 ` Doug Ledford
2002-08-01 1:16 ` Jeremy Higdon
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=3D4757FF.9F91971F@torque.net \
--to=dougg@torque.net \
--cc=andmike@us.ibm.com \
--cc=haofengk@ptu.promise.com \
--cc=linux-scsi@vger.kernel.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